freeChunk() — netty Function Reference
Architecture documentation for the freeChunk() function in PoolArena.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 49dbf789_be1b_69c7_042a_27d74a8c475d["freeChunk()"] de926ba9_75e3_c416_27fc_3623234991a8["PoolArena"] 49dbf789_be1b_69c7_042a_27d74a8c475d -->|defined in| de926ba9_75e3_c416_27fc_3623234991a8 1eb7867b_3257_ad29_cda0_1b8484056b67["free()"] 1eb7867b_3257_ad29_cda0_1b8484056b67 -->|calls| 49dbf789_be1b_69c7_042a_27d74a8c475d a9955d3f_a5f7_e9ad_827d_87d47e26b575["lock()"] 49dbf789_be1b_69c7_042a_27d74a8c475d -->|calls| a9955d3f_a5f7_e9ad_827d_87d47e26b575 1eb7867b_3257_ad29_cda0_1b8484056b67["free()"] 49dbf789_be1b_69c7_042a_27d74a8c475d -->|calls| 1eb7867b_3257_ad29_cda0_1b8484056b67 c24c38bc_94a5_6dd7_1e0a_4abbf00b61e7["unlock()"] 49dbf789_be1b_69c7_042a_27d74a8c475d -->|calls| c24c38bc_94a5_6dd7_1e0a_4abbf00b61e7 ae1f5354_6c2b_3fd8_c85d_14af9d52df05["destroyChunk()"] 49dbf789_be1b_69c7_042a_27d74a8c475d -->|calls| ae1f5354_6c2b_3fd8_c85d_14af9d52df05 style 49dbf789_be1b_69c7_042a_27d74a8c475d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
buffer/src/main/java/io/netty/buffer/PoolArena.java lines 259–290
void freeChunk(PoolChunk<T> chunk, long handle, int normCapacity, SizeClass sizeClass, ByteBuffer nioBuffer,
boolean finalizer) {
final boolean destroyChunk;
lock();
try {
// We only call this if freeChunk is not called because of the PoolThreadCache finalizer as otherwise this
// may fail due lazy class-loading in for example tomcat.
if (!finalizer) {
switch (sizeClass) {
case Normal:
++deallocationsNormal;
break;
case Small:
++deallocationsSmall;
break;
default:
throw new Error("Unexpected size class: " + sizeClass);
}
}
destroyChunk = !chunk.parent.free(chunk, handle, normCapacity, nioBuffer);
if (destroyChunk) {
// all other destroyChunk calls come from the arena itself being finalized, so don't need to be counted
++pooledChunkDeallocations;
}
} finally {
unlock();
}
if (destroyChunk) {
// destroyChunk not need to be called while holding the synchronized lock.
destroyChunk(chunk);
}
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does freeChunk() do?
freeChunk() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/PoolArena.java.
Where is freeChunk() defined?
freeChunk() is defined in buffer/src/main/java/io/netty/buffer/PoolArena.java at line 259.
What does freeChunk() call?
freeChunk() calls 4 function(s): destroyChunk, free, lock, unlock.
What calls freeChunk()?
freeChunk() is called by 1 function(s): free.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free