/** Return a chunk, the caller will take owership of the parent chunk. */ public Chunk get() { while (true) { Chunk chunk = chunks.poll(); if (chunk != null) return chunk; if (!allocateMoreChunks()) // give it one last attempt, in case someone else allocated before us return chunks.poll(); } }
/** This is not thread safe and should only be used for unit testing. */ @VisibleForTesting static void reset() { localPool.get().reset(); globalPool.reset(); }
"Attempting to continue; buffers will be allocated in on-heap memory which can degrade performance. " + "Make sure direct memory size (-XX:MaxDirectMemorySize) is large enough to accommodate off-heap memtables and caches.", MACRO_CHUNK_SIZE, sizeInBytes(), oom.toString()); return false;
"Make sure direct memory size (-XX:MaxDirectMemorySize) is large enough to accommodate off-heap memtables and caches.", FBUtilities.prettyPrintMemory(MACRO_CHUNK_SIZE), FBUtilities.prettyPrintMemory(sizeInBytes()), oom.toString()); return false;
"Make sure direct memory size (-XX:MaxDirectMemorySize) is large enough to accommodate off-heap memtables and caches.", FBUtilities.prettyPrintMemory(MACRO_CHUNK_SIZE), FBUtilities.prettyPrintMemory(sizeInBytes()), oom.toString()); return false;
"Attempting to continue; buffers will be allocated in on-heap memory which can degrade performance. " + "Make sure direct memory size (-XX:MaxDirectMemorySize) is large enough to accommodate off-heap memtables and caches.", MACRO_CHUNK_SIZE, sizeInBytes(), oom.toString()); return false;
public static long sizeInBytes() { return globalPool.sizeInBytes(); }
public static long sizeInBytes() { return globalPool.sizeInBytes(); }
private Chunk addChunkFromGlobalPool() { Chunk chunk = globalPool.get(); if (chunk == null) return null; addChunk(chunk); return chunk; }
void recycle() { assert freeSlots == 0L; globalPool.recycle(new Chunk(this)); }
/** Return a chunk, the caller will take owership of the parent chunk. */ public Chunk get() { while (true) { Chunk chunk = chunks.poll(); if (chunk != null) return chunk; if (!allocateMoreChunks()) // give it one last attempt, in case someone else allocated before us return chunks.poll(); } }
/** Return a chunk, the caller will take owership of the parent chunk. */ public Chunk get() { while (true) { Chunk chunk = chunks.poll(); if (chunk != null) return chunk; if (!allocateMoreChunks()) // give it one last attempt, in case someone else allocated before us return chunks.poll(); } }
private Chunk addChunkFromGlobalPool() { Chunk chunk = globalPool.get(); if (chunk == null) return null; addChunk(chunk); return chunk; }
void recycle() { assert freeSlots == 0L; globalPool.recycle(new Chunk(this)); }
/** Return a chunk, the caller will take owership of the parent chunk. */ public Chunk get() { while (true) { Chunk chunk = chunks.poll(); if (chunk != null) return chunk; if (!allocateMoreChunks()) // give it one last attempt, in case someone else allocated before us return chunks.poll(); } }
public static long sizeInBytes() { return globalPool.sizeInBytes(); }
public static long sizeInBytes() { return globalPool.sizeInBytes(); }
private Chunk addChunkFromGlobalPool() { Chunk chunk = globalPool.get(); if (chunk == null) return null; addChunk(chunk); return chunk; }
void recycle() { assert freeSlots == 0L; globalPool.recycle(new Chunk(this)); }
void recycle() { assert freeSlots == 0L; globalPool.recycle(new Chunk(this)); }