private void performRelease() { if (refCount.get() > 0) { LOGGER.info("NativeBytesStore discarded without releasing ", createdHere); } memory = null; if (cleaner != null) cleaner.clean(); }
public static void cleanDirectBuffer(Buffer mappedFile) { if (mappedFile instanceof DirectBuffer) { Cleaner cleaner = ((DirectBuffer) mappedFile).cleaner(); if (cleaner != null) { cleaner.clean(); } } }
/** * Force to unmap direct buffer if the buffer is no longer used. It is unsafe operation and * currently a walk-around to avoid huge memory occupation caused by memory map. * * @param buffer the byte buffer to be unmapped */ public static void cleanDirectBuffer(ByteBuffer buffer) { if (buffer == null) { return; } if (buffer.isDirect()) { Cleaner cleaner = ((DirectBuffer) buffer).cleaner(); cleaner.clean(); } }
public void free() { cleaner.clean(); }
private void clean(MappedByteBuffer mapping) { if (mapping == null) return; Cleaner cleaner = ((DirectBuffer) mapping).cleaner(); if (cleaner != null) cleaner.clean(); }
@Override public void free() { cleaner.clean(); }