Package com.netflix.zeno.util.collections.heapfriendly

Examples of com.netflix.zeno.util.collections.heapfriendly.HeapFriendlyMapArrayRecycler


        }
    }

    @Test
    public void recyclesObjectArraysFromAlternatingCycles() throws Exception {
        HeapFriendlyMapArrayRecycler recycler = HeapFriendlyMapArrayRecycler.get();

        HeapFriendlyDerivableKeyHashMap<String, Integer> map = getMap(100);
        Object[] firstSegment = getFirstSegment(map);

        recycler.swapCycleObjectArrays();

        map.releaseObjectArrays();
        recycler.clearNextCycleObjectArrays();
        map = getMap(100);
        Object[] differentFirstSegment = getFirstSegment(map);

        Assert.assertNotSame(firstSegment, differentFirstSegment);

        recycler.swapCycleObjectArrays();

        map.releaseObjectArrays();
        recycler.clearNextCycleObjectArrays();
        map = getMap(100);
        Object[] firstSegmentAgain = getFirstSegment(map);

        Assert.assertSame(firstSegment, firstSegmentAgain);
    }
View Full Code Here

TOP

Related Classes of com.netflix.zeno.util.collections.heapfriendly.HeapFriendlyMapArrayRecycler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.