Replies: 1 comment 3 replies
-
The real struggle here is that even calling |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Similarly to https://openjdk.java.net/jeps/346 / https://openjdk.java.net/jeps/8204088 /
-XX:SoftMaxHeapSize
(see https://bugs.openjdk.org/browse/JDK-8222145 too, which is unrelated to the soft limit, but a required detail for this Netty feature, instead) , it would be nice if Netty pooled allocator would be able to return back some memory to the OS based on some soft limit and time/load/capacity configurable policies.This would be very useful for containerized applications (or mild loaded ones): jemalloc as well is able to uncommit memory back to the OS under certain conditions, but I didn't dig further how much it looks like the feature I'm proposing.
Comments/ideas are wellcome!
NOTES:
right now I see that only huge allocations and finalized arenas benefit from being released/releasable.
An easy approach, although less precise, to solve this would be that when total allocations exceed a soft limit, the added chunk should be created as "unpooled" (meaning that would be released and uncommitted when not used/referenced anymore); in addition a global tick + lease renew on usage can help deciding when is time to release it for real, in case a max-idle-time is configured for the memory allocated beyond the soft limit. While half-dead (eligible for GC), the chunk is still available to be (re)used to cope with incoming load.
Beta Was this translation helpful? Give feedback.
All reactions