/** * Frees off heap memory. */ public void tearDown() throws Exception { SimpleMemoryAllocatorImpl.freeOffHeapMemory(); System.clearProperty("gemfire.validateOffHeapWithFill"); }
@After public void tearDown() throws Exception { SimpleMemoryAllocatorImpl.removeLifecycleListener(this.listener); this.afterCreateCallbacks.clear(); this.afterReuseCallbacks.clear(); this.beforeCloseCallbacks.clear(); SimpleMemoryAllocatorImpl.freeOffHeapMemory(); }
@SuppressWarnings("unused") // invoked by reflection from tearDown2() private static void cleanup() { try { //cache.get().getLogger().info(REMOVE_EXPECTED_EXCEPTIONS); //getCache().getLogger().info(REMOVE_EXPECTED_EXCEPTIONS); getLogWriter().info(REMOVE_EXPECTED_EXCEPTIONS); } finally { disconnectFromDS(); SimpleMemoryAllocatorImpl.freeOffHeapMemory(); cache.set(null); system.set(null); isSmallerVM.set(false); } }
assertTrue(ooom.get().getMessage().contains("Out of off-heap memory. Could not allocate size of ")); } finally { SimpleMemoryAllocatorImpl.freeOffHeapMemory();
public void testSizeAllocation() { // prevent cache from closing in reaction to ooom System.setProperty(OffHeapStorage.STAY_CONNECTED_ON_OUTOFOFFHEAPMEMORY_PROPERTY, "true"); GemFireCacheImpl gfc = createCache(); try { MemoryAllocator ma = gfc.getOffHeapStore(); assertNotNull(ma); final long offHeapSize = ma.getFreeMemory(); assertEquals(0, ma.getUsedMemory()); MemoryChunk mc1 = ma.allocate(64, null); assertEquals(64+perObjectOverhead(), ma.getUsedMemory()); assertEquals(offHeapSize-(64+perObjectOverhead()), ma.getFreeMemory()); mc1.release(); assertEquals(offHeapSize, ma.getFreeMemory()); assertEquals(0, ma.getUsedMemory()); // do an allocation larger than the slab size try { ma.allocate(1024*1024*10, null); fail("Expected an out of heap exception"); } catch (OutOfOffHeapMemoryException expected) { } assertEquals(0, ma.getUsedMemory()); assertFalse(gfc.isClosed()); } finally { System.clearProperty(OffHeapStorage.STAY_CONNECTED_ON_OUTOFOFFHEAPMEMORY_PROPERTY); closeCache(gfc); SimpleMemoryAllocatorImpl.freeOffHeapMemory(); } }
SimpleMemoryAllocatorImpl.freeOffHeapMemory();
} finally { closeCache(gfc); SimpleMemoryAllocatorImpl.freeOffHeapMemory();
bmc.release(); } finally { SimpleMemoryAllocatorImpl.freeOffHeapMemory();
} finally { closeCache(gfc); SimpleMemoryAllocatorImpl.freeOffHeapMemory();
SimpleMemoryAllocatorImpl.freeOffHeapMemory();
SimpleMemoryAllocatorImpl.freeOffHeapMemory();