@Override public void run() { doPut(key,value,regionName,expectException); } });
/** * Consumes off off-heap memory until the allocation size cannot be satisfied. * @param allocationSize the number of bytes for each allocation * @return the number of successful puts */ protected int doConsumeOffHeapMemory(int allocationSize) { // TODO:KIRK: change this to handle new OutOfOffHeapMemoryException OffHeapMemoryStats stats = ((GemFireCacheImpl) getCache()).getOffHeapStore().getStats(); int i = 0; // Loop until we fail try { while(true) { doPut("KEY" + (i++),new byte[allocationSize],OFF_HEAP_REGION_NAME, false); } } catch (OutOfOffHeapMemoryException e) { } return i; }