resources.trySetThreadPoolSize(threadPoolSize); this.sharedCache = CacheManager.INSTANCE.acquire(getCacheIdentifier(connectionConfig));
resources.trySetThreadPoolSize(threadPoolSize); this.sharedCache = CacheManager.INSTANCE.acquire(getCacheIdentifier(connectionConfig));
public void setUp() throws Exception { cache = CacheManager.INSTANCE.acquire("unique-cache-id"); Stopwatch sw = Stopwatch.createStarted(); Runtime runtime = Runtime.getRuntime(); System.gc(); System.runFinalization(); Thread.sleep(3000); long mem = runtime.totalMemory() - Runtime.getRuntime().freeMemory(); leafTrees = createLeafTrees(treeCount); System.gc(); System.runFinalization(); Thread.sleep(3000); long mem2 = runtime.totalMemory() - Runtime.getRuntime().freeMemory(); System.err.printf("leaf tree mem: %,d\n", mem2 - mem); bucketTrees = createBucketTrees(treeCount); features = createFeatures(featureCount); sw.stop(); System.err.printf("Created %,d features, %,d trees, %,d buckets in %s\n", featureCount, treeCount, treeCount, sw); }
public void setUp() throws Exception { cache = CacheManager.INSTANCE.acquire("unique-cache-id"); Stopwatch sw = Stopwatch.createStarted(); Runtime runtime = Runtime.getRuntime(); System.gc(); System.runFinalization(); Thread.sleep(3000); long mem = runtime.totalMemory() - Runtime.getRuntime().freeMemory(); leafTrees = createLeafTrees(treeCount); System.gc(); System.runFinalization(); Thread.sleep(3000); long mem2 = runtime.totalMemory() - Runtime.getRuntime().freeMemory(); System.err.printf("leaf tree mem: %,d\n", mem2 - mem); bucketTrees = createBucketTrees(treeCount); features = createFeatures(featureCount); sw.stop(); System.err.printf("Created %,d features, %,d trees, %,d buckets in %s\n", featureCount, treeCount, treeCount, sw); }
public @Test void release() { ObjectCache cache1 = cacheManager.acquire("id1"); ObjectCache cache2 = cacheManager.acquire("id1"); ObjectCache cache3 = cacheManager.acquire("id2"); assertNotNull(cache1); assertSame(cache1, cache2); assertNotNull(cache3); assertNotSame(cache1, cache3); cacheManager.release(cache1); cacheManager.release(cache2); ObjectCache cache4 = cacheManager.acquire("id1"); assertNotNull(cache4); assertNotSame(cache1, cache4); ObjectCache cache5 = cacheManager.acquire("id2"); assertSame(cache3, cache5); }
public @Test void release() { ObjectCache cache1 = cacheManager.acquire("id1"); ObjectCache cache2 = cacheManager.acquire("id1"); ObjectCache cache3 = cacheManager.acquire("id2"); assertNotNull(cache1); assertSame(cache1, cache2); assertNotNull(cache3); assertNotSame(cache1, cache3); cacheManager.release(cache1); cacheManager.release(cache2); ObjectCache cache4 = cacheManager.acquire("id1"); assertNotNull(cache4); assertNotSame(cache1, cache4); ObjectCache cache5 = cacheManager.acquire("id2"); assertSame(cache3, cache5); }