public long getOffHeapUsedMemory() { long usedSize = 0; OffHeapMemoryStats stats = getOffHeapStats(); if(null != stats) { usedSize = stats.getUsedMemory(); } return usedSize; }
public long getOffHeapUsedMemory() { long usedSize = 0; OffHeapMemoryStats stats = getOffHeapStats(); if(null != stats) { usedSize = stats.getUsedMemory(); } return usedSize; }
/** Get the current number of bytes in the region. * */ protected long getRegionSizeInBytes() { Region workRegion = getWorkRegion(); int numKeys = workRegion.keys().size(); CapConBB.getBB().getSharedCounters().setIfLarger(CapConBB.MAX_NUM_KEYS, numKeys); if (workRegion.getAttributes().getEnableOffHeapMemory()) { GemFireCacheImpl gfCache = (GemFireCacheImpl)(CacheUtil.getCache()); return gfCache.getOffHeapStore().getStats().getUsedMemory(); } else { return memLRUParams.getTotalBytesPerEntry() * numKeys; } }
while (true) { for (Region aRegion: regionSet) { long currentOffHeapSizeInBytes = offHeapStats.getUsedMemory();; Log.getLogWriter().info("currentOffHeapSizeinBytes = " + currentOffHeapSizeInBytes + ", threshold in bytes is " + thresholdInBytes); if (currentOffHeapSizeInBytes < thresholdInBytes) {
@Override public void initialize(OffHeapMemoryStats oldStats) { setFreeMemory(oldStats.getFreeMemory()); setMaxMemory(oldStats.getMaxMemory()); setUsedMemory(oldStats.getUsedMemory()); setObjects(oldStats.getObjects()); setReads(oldStats.getReads()); setCompactions(oldStats.getCompactions()); setFragments(oldStats.getFragments()); setLargestFragment(oldStats.getLargestFragment()); setCompactionTime(oldStats.getCompactionTime()); setFragmentation(oldStats.getFragmentation()); oldStats.close(); }
@Override public void initialize(OffHeapMemoryStats oldStats) { setFreeMemory(oldStats.getFreeMemory()); setMaxMemory(oldStats.getMaxMemory()); setUsedMemory(oldStats.getUsedMemory()); setObjects(oldStats.getObjects()); setReads(oldStats.getReads()); setCompactions(oldStats.getCompactions()); setFragments(oldStats.getFragments()); setLargestFragment(oldStats.getLargestFragment()); setCompactionTime(oldStats.getCompactionTime()); setFragmentation(oldStats.getFragmentation()); oldStats.close(); }
long usedOffHeapMemory = offHeapStats.getUsedMemory(); Log.getLogWriter().info("Off-heap memory, used bytes: " + usedOffHeapMemory + ", byteLimit: " + byteLimit); if (usedOffHeapMemory > byteLimit) {