public void relaseMemoryForInternalRegions(){ if (this.reservedTable() && needAccounting()) { callback.dropStorageMemory(getFullPath(), 0L); } }
public void acquirePoolMemory(long oldSize, long newSize, boolean withEntryOverHead, UMMMemoryTracker buffer, boolean shouldEvict) throws LowMemoryException { if (!this.reservedTable() && needAccounting()) { long size = 0L; if (withEntryOverHead) { size = (newSize - oldSize) + Math.max(0L, entryOverHead); } else { size = (newSize - oldSize); } if (!callback.acquireStorageMemory(getFullPath(), size, buffer, shouldEvict, false)) { throwLowMemoryException(size); } } }
public void freePoolMemory(long oldSize, boolean withEntryOverHead) { if (!this.reservedTable() && needAccounting()) { if (withEntryOverHead) { callback.releaseStorageMemory(getFullPath(), oldSize + Math.max(0L, entryOverHead), false); } else { callback.releaseStorageMemory(getFullPath(), oldSize, false); } } }
protected long calculateEntryOverhead(RegionEntry entry) { if (entryOverHead == -1L && !this.reservedTable() && needAccounting()) { synchronized (this) { if (entryOverHead == -1L) { entryOverHead = getEntryOverhead(entry); memTrace("Entry overhead for " + getFullPath() + " = " + entryOverHead); } } } return entryOverHead; }
protected long calculateDiskIdOverhead(DiskId diskId) { if (!this.reservedTable() && diskIdOverHead == -1L && needAccounting()) { diskIdOverHead = ReflectionObjectSizer.getInstance().sizeof(diskId); memTrace("diskIdOverHead = " + diskIdOverHead); } return diskIdOverHead; }
protected void accountRegionOverhead() {// Not throwing LowMemoryException while region creation if (!this.reservedTable() && !regionOverHeadAccounted && needAccounting()) { synchronized (this) { if (!regionOverHeadAccounted) { this.regionOverHead = ReflectionSingleObjectSizer.INSTANCE.sizeof(this); callback.acquireStorageMemory(getFullPath(), regionOverHead, null, true, false); regionOverHeadAccounted = true; } } } }
void updateSizeOnClearRegion(int sizeBeforeClear) { if(!this.reservedTable() && needAccounting()) { long ignoreBytes = this.isDestroyed() ? getIgnoreBytes() : getIgnoreBytes() + regionOverHead; callback.dropStorageMemory(getFullPath(), ignoreBytes); } }
if (!region.reservedTable() && region.needAccounting()) { NonLocalRegionEntry nre = (NonLocalRegionEntry)re; region.freePoolMemory(nre.getValueSize(), nre.isForDelete());
protected void delayedAcquirePoolMemory(long oldSize, long newSize, boolean withEntryOverHead, boolean shouldEvict) throws LowMemoryException { if (!this.reservedTable() && needAccounting()) { long size; if (withEntryOverHead) { size = (newSize - oldSize) + Math.max(0L, entryOverHead); } else { size = (newSize - oldSize); } if (MAX_VALUE_BEFORE_ACQUIRE == 1 || size > MAX_VALUE_BEFORE_ACQUIRE) { if (!callback.acquireStorageMemory(getFullPath(), (size), null, shouldEvict, false)) { throwLowMemoryException(size); } } else { long prevValue = memoryBeforeAcquire.getAndAccumulate(size, op); long currValue = prevValue + size; if (currValue >= MAX_VALUE_BEFORE_ACQUIRE) { if (!callback.acquireStorageMemory(getFullPath(), MAX_VALUE_BEFORE_ACQUIRE, null, shouldEvict, false)) { throwLowMemoryException(size); } } } } }
if (!region.reservedTable() && region.needAccounting()) { region.calculateEntryOverhead(oldRe); region.acquirePoolMemory(0, oldRe.getValueSize(), oldRe.isForDelete(), null, true);
try { setNewValueBucketSize(owner, v); if(!region.reservedTable() && region.needAccounting()){ owner.calculateEntryOverhead(reentry); acquireMemory(owner, this, oldValueSize, this.op.isUpdate(), isTombstone);