Motivation: Allocating memory is expensive, which is why we pool our allocations. The cleaner, when used with pooled memory, should then return that memory to the pool instead of deallocating it. The purpose of the cleaner is, after all, to avoid having to track the reference counts so precisely. Modification: The NativeMemoryCleanerDrop is now able to either recover lost memory segments, when a buffer wasn't closed explicitly and is being cleaned by the GC, or return the buffer to the pool via ordinary drop. The GatedCleanable has been added, because buffer ownership transfer involves generating new memory segments, and in those cases we need to invalidate the old cleanables without deallocating the tracked memory segment or returning it to the pool more than once. Result: The pooledDirectWithCleaner allocator is now able to reuse memory segments, even when their references are forgotten and they processed by the cleaner thread.
Netty Incubator Buffer API
This repository is incubating a new buffer API proposed for Netty 5.
Description
Languages
Java
99.6%
Dockerfile
0.2%
Makefile
0.2%