GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Fix direct memory OOM on low-core containers by franz1981 · Pull Request #17166 · netty/netty Fix direct memory OOM on low-core containers #17166New issueHave a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails. Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filterConversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page. Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page. Diff viewDiff view
Next
Fix direct memory OOM on low-core containers
Motivation: PR #16766 introduced SHARED_CACHE_CAPACITY = max(128, CHUNK_REUSE_QUEUE * 2) to prevent chunk churn. On 1-core containers where CHUNK_REUSE_QUEUE is 2, the 128-slot floor allows each of the 16 size classes to retain up to 128 chunks of ~128 KB, totalling 256 MB of direct memory in caches alone. On JDK 21 without -Dio.netty.tryReflectionSetAccessible=true, Netty allocates direct chunks via ByteBuffer.allocateDirect(), tracked against MaxDirectMemorySize. The cache capacity can exhaust the entire direct memory budget, causing OOM as reported in #17107. Additionally, IS_LOW_MEM (triggered when Runtime.maxMemory() <= 512 MB) uses heap budget as a proxy for native memory availability, which is wrong for off-heap workloads. There is no override for users who know their environment better than the heuristic. Modification: - Reduce the SHARED_CACHE_CAPACITY floor from 128 to 16. - Add io.netty.allocator.lowMemory system property to override IS_LOW_MEM auto-detection, following the precedent of the existing disableThreadLocalMagazinesOnLowMemory property. - Fix cacheSettlesAfterBurstShared test to cap excess chunks within SHARED_CACHE_CAPACITY, preventing silent drops on the bounded MPMC queue when CHUNK_REUSE_QUEUE is large relative to the capacity floor. Result: Worst-case cache retention drops from 256 MB to 32 MB on 1-4 core machines. The CHUNK_REUSE_QUEUE * 2 formula still governs on 8+ cores (same as before). The floor of 16 is 8x the pre-#16766 capacity on 1-core, so the original chunk churn problem does not regress. Users can force IS_LOW_MEM on or off via -Dio.netty.allocator.lowMemory.
Uh oh!
There was an error while loading. Please reload this page.
commit 1b83f89d8d29ef3b6e3cdfceb0804c17b6e22f19
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |