allocator.onHeap().allocate(overhead, opGroup); initialSize = 8;
public String toString() { return String.format("Memtable-%s@%s(%s serialized bytes, %s ops, %.0f%%/%.0f%% of on/off-heap limit)", cfs.name, hashCode(), FBUtilities.prettyPrintMemory(liveDataSize.get()), currentOperations, 100 * allocator.onHeap().ownershipRatio(), 100 * allocator.offHeap().ownershipRatio()); }
public Reclaimer reclaimImmediately(Cell cell) { onHeap().released(cell.name().dataSize() + cell.value().remaining()); return this; }
onHeap += current.getAllocator().onHeap().ownershipRatio(); offHeap += current.getAllocator().offHeap().ownershipRatio(); onHeap += allocator.onHeap().ownershipRatio(); offHeap += allocator.offHeap().ownershipRatio(); float flushingOnHeap = Memtable.MEMORY_POOL.onHeap.reclaimingRatio(); float flushingOffHeap = Memtable.MEMORY_POOL.offHeap.reclaimingRatio(); float thisOnHeap = largest.getAllocator().onHeap().ownershipRatio(); float thisOffHeap = largest.getAllocator().onHeap().ownershipRatio(); logger.info("Flushing largest {} to free up room. Used total: {}, live: {}, flushing: {}, this: {}", largest.cfs, ratio(usedOnHeap, usedOffHeap), ratio(liveOnHeap, liveOffHeap),
onHeap += current.getAllocator().onHeap().ownershipRatio(); offHeap += current.getAllocator().offHeap().ownershipRatio(); onHeap += allocator.onHeap().ownershipRatio(); offHeap += allocator.offHeap().ownershipRatio(); float flushingOnHeap = Memtable.MEMORY_POOL.onHeap.reclaimingRatio(); float flushingOffHeap = Memtable.MEMORY_POOL.offHeap.reclaimingRatio(); float thisOnHeap = largest.getAllocator().onHeap().ownershipRatio(); float thisOffHeap = largest.getAllocator().offHeap().ownershipRatio(); logger.debug("Flushing largest {} to free up room. Used total: {}, live: {}, flushing: {}, this: {}", largest.cfs, ratio(usedOnHeap, usedOffHeap), ratio(liveOnHeap, liveOffHeap),
onHeap += current.getAllocator().onHeap().ownershipRatio(); offHeap += current.getAllocator().offHeap().ownershipRatio(); onHeap += allocator.onHeap().ownershipRatio(); offHeap += allocator.offHeap().ownershipRatio(); float flushingOnHeap = Memtable.MEMORY_POOL.onHeap.reclaimingRatio(); float flushingOffHeap = Memtable.MEMORY_POOL.offHeap.reclaimingRatio(); float thisOnHeap = largest.getAllocator().onHeap().ownershipRatio(); float thisOffHeap = largest.getAllocator().offHeap().ownershipRatio(); logger.debug("Flushing largest {} to free up room. Used total: {}, live: {}, flushing: {}, this: {}", largest.cfs, ratio(usedOnHeap, usedOffHeap), ratio(liveOnHeap, liveOffHeap),
onHeap += current.getAllocator().onHeap().ownershipRatio(); offHeap += current.getAllocator().offHeap().ownershipRatio(); onHeap += allocator.onHeap().ownershipRatio(); offHeap += allocator.offHeap().ownershipRatio(); float flushingOnHeap = Memtable.MEMORY_POOL.onHeap.reclaimingRatio(); float flushingOffHeap = Memtable.MEMORY_POOL.offHeap.reclaimingRatio(); float thisOnHeap = largest.getAllocator().onHeap().ownershipRatio(); float thisOffHeap = largest.getAllocator().offHeap().ownershipRatio(); logger.debug("Flushing largest {} to free up room. Used total: {}, live: {}, flushing: {}, this: {}", largest.cfs, ratio(usedOnHeap, usedOffHeap), ratio(liveOnHeap, liveOffHeap),
allocator.onHeap().allocate(overhead, opGroup); initialSize = 8;
allocator.onHeap().allocate(overhead, opGroup); initialSize = 8;
allocator.onHeap().allocate(overhead, opGroup); initialSize = 8;
allocator.onHeap().allocate(overhead, opGroup); initialSize = 8;
public ByteBuffer allocate(int size, OpOrder.Group opGroup) { assert size >= 0; if (size == 0) return ByteBufferUtil.EMPTY_BYTE_BUFFER; (allocateOnHeapOnly ? onHeap() : offHeap()).allocate(size, opGroup); // satisfy large allocations directly from JVM since they don't cause fragmentation // as badly, and fill up our regions quickly if (size > MAX_CLONED_SIZE) { unslabbedSize.addAndGet(size); if (allocateOnHeapOnly) return ByteBuffer.allocate(size); Region region = new Region(ByteBuffer.allocateDirect(size)); offHeapRegions.add(region); return region.allocate(size); } while (true) { Region region = getRegion(); // Try to allocate from this region ByteBuffer cloned = region.allocate(size); if (cloned != null) return cloned; // not enough space! currentRegion.compareAndSet(region, null); } }
public ByteBuffer allocate(int size, OpOrder.Group opGroup) { assert size >= 0; if (size == 0) return ByteBufferUtil.EMPTY_BYTE_BUFFER; (allocateOnHeapOnly ? onHeap() : offHeap()).allocate(size, opGroup); // satisfy large allocations directly from JVM since they don't cause fragmentation // as badly, and fill up our regions quickly if (size > MAX_CLONED_SIZE) { unslabbedSize.addAndGet(size); if (allocateOnHeapOnly) return ByteBuffer.allocate(size); Region region = new Region(ByteBuffer.allocateDirect(size)); offHeapRegions.add(region); return region.allocate(size); } while (true) { Region region = getRegion(); // Try to allocate from this region ByteBuffer cloned = region.allocate(size); if (cloned != null) return cloned; // not enough space! currentRegion.compareAndSet(region, null); } }
public ByteBuffer allocate(int size, OpOrder.Group opGroup) { assert size >= 0; if (size == 0) return ByteBufferUtil.EMPTY_BYTE_BUFFER; (allocateOnHeapOnly ? onHeap() : offHeap()).allocate(size, opGroup); // satisfy large allocations directly from JVM since they don't cause fragmentation // as badly, and fill up our regions quickly if (size > MAX_CLONED_SIZE) { unslabbedSize.addAndGet(size); if (allocateOnHeapOnly) return ByteBuffer.allocate(size); Region region = new Region(ByteBuffer.allocateDirect(size)); offHeapRegions.add(region); return region.allocate(size); } while (true) { Region region = getRegion(); // Try to allocate from this region ByteBuffer cloned = region.allocate(size); if (cloned != null) return cloned; // not enough space! currentRegion.compareAndSet(region, null); } }
public ByteBuffer allocate(int size, OpOrder.Group opGroup) { assert size >= 0; if (size == 0) return ByteBufferUtil.EMPTY_BYTE_BUFFER; (allocateOnHeapOnly ? onHeap() : offHeap()).allocate(size, opGroup); // satisfy large allocations directly from JVM since they don't cause fragmentation // as badly, and fill up our regions quickly if (size > MAX_CLONED_SIZE) { unslabbedSize.addAndGet(size); if (allocateOnHeapOnly) return ByteBuffer.allocate(size); Region region = new Region(ByteBuffer.allocateDirect(size)); offHeapRegions.add(region); return region.allocate(size); } while (true) { Region region = getRegion(); // Try to allocate from this region ByteBuffer cloned = region.allocate(size); if (cloned != null) return cloned; // not enough space! currentRegion.compareAndSet(region, null); } }
private void logFlush() { // reclaiming includes that which we are GC-ing; float onHeapRatio = 0, offHeapRatio = 0; long onHeapTotal = 0, offHeapTotal = 0; Memtable memtable = getTracker().getView().getCurrentMemtable(); onHeapRatio += memtable.getAllocator().onHeap().ownershipRatio(); offHeapRatio += memtable.getAllocator().offHeap().ownershipRatio(); onHeapTotal += memtable.getAllocator().onHeap().owns(); offHeapTotal += memtable.getAllocator().offHeap().owns(); for (ColumnFamilyStore indexCfs : indexManager.getAllIndexColumnFamilyStores()) { MemtableAllocator allocator = indexCfs.getTracker().getView().getCurrentMemtable().getAllocator(); onHeapRatio += allocator.onHeap().ownershipRatio(); offHeapRatio += allocator.offHeap().ownershipRatio(); onHeapTotal += allocator.onHeap().owns(); offHeapTotal += allocator.offHeap().owns(); } logger.debug("Enqueuing flush of {}: {}", name, String.format("%s (%.0f%%) on-heap, %s (%.0f%%) off-heap", FBUtilities.prettyPrintMemory(onHeapTotal), onHeapRatio * 100, FBUtilities.prettyPrintMemory(offHeapTotal), offHeapRatio * 100)); }
public ByteBuffer allocate(int size, OpOrder.Group opGroup) { assert size >= 0; if (size == 0) return ByteBufferUtil.EMPTY_BYTE_BUFFER; (allocateOnHeapOnly ? onHeap() : offHeap()).allocate(size, opGroup); // satisfy large allocations directly from JVM since they don't cause fragmentation // as badly, and fill up our regions quickly if (size > MAX_CLONED_SIZE) { unslabbedSize.addAndGet(size); if (allocateOnHeapOnly) return ByteBuffer.allocate(size); Region region = new Region(ByteBuffer.allocateDirect(size)); offHeapRegions.add(region); return region.allocate(size); } while (true) { Region region = getRegion(); // Try to allocate from this region ByteBuffer cloned = region.allocate(size); if (cloned != null) return cloned; // not enough space! currentRegion.compareAndSet(region, null); } }
public void allocate(long size, OpOrder.Group opGroup) { assert size >= 0; while (true) { if (parent.tryAllocate(size)) { acquired(size); return; } WaitQueue.Signal signal = opGroup.isBlockingSignal(parent.hasRoom().register(parent.blockedTimerContext())); boolean allocated = parent.tryAllocate(size); if (allocated || opGroup.isBlocking()) { signal.cancel(); if (allocated) // if we allocated, take ownership acquired(size); else // otherwise we're blocking so we're permitted to overshoot our constraints, to just allocate without blocking allocated(size); return; } else signal.awaitUninterruptibly(); } }
private void logFlush() { // reclaiming includes that which we are GC-ing; float onHeapRatio = 0, offHeapRatio = 0; long onHeapTotal = 0, offHeapTotal = 0; Memtable memtable = getTracker().getView().getCurrentMemtable(); onHeapRatio += memtable.getAllocator().onHeap().ownershipRatio(); offHeapRatio += memtable.getAllocator().offHeap().ownershipRatio(); onHeapTotal += memtable.getAllocator().onHeap().owns(); offHeapTotal += memtable.getAllocator().offHeap().owns(); for (ColumnFamilyStore indexCfs : indexManager.getAllIndexColumnFamilyStores()) { MemtableAllocator allocator = indexCfs.getTracker().getView().getCurrentMemtable().getAllocator(); onHeapRatio += allocator.onHeap().ownershipRatio(); offHeapRatio += allocator.offHeap().ownershipRatio(); onHeapTotal += allocator.onHeap().owns(); offHeapTotal += allocator.offHeap().owns(); } logger.debug("Enqueuing flush of {}: {}", name, String.format("%s (%.0f%%) on-heap, %s (%.0f%%) off-heap", FBUtilities.prettyPrintMemory(onHeapTotal), onHeapRatio * 100, FBUtilities.prettyPrintMemory(offHeapTotal), offHeapRatio * 100)); }
public void allocate(long size, OpOrder.Group opGroup) { assert size >= 0; while (true) { if (parent.tryAllocate(size)) { acquired(size); return; } WaitQueue.Signal signal = opGroup.isBlockingSignal(parent.hasRoom().register(parent.blockedTimerContext())); boolean allocated = parent.tryAllocate(size); if (allocated || opGroup.isBlocking()) { signal.cancel(); if (allocated) // if we allocated, take ownership acquired(size); else // otherwise we're blocking so we're permitted to overshoot our constraints, to just allocate without blocking allocated(size); return; } else signal.awaitUninterruptibly(); } }