Extend memory_limit to the remaining caches - #7966
Draft
dangell7 wants to merge 2 commits into
Draft
Conversation
2 tasks
dangell7
force-pushed
the
dangell7/memory-pressure
branch
from
August 6, 2026 19:18
b7011af to
36a6599
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
High Level Overview of Change
Stacked on #7965; merges after it.
Extends the
[memory_limit]budget to the caches that #7965 left on sweep-only sizing: the NodeStore object cache, the ledger cache, the cached SLEs, and fetch packs.Context of Change
TaggedCachegains an opt-in byte budget: a bytes value and a cost function charge each entry while it is strongly cached, and growth past the budget evicts through the same path as the entry cap. The charges stay correct through inserts, revivals, replacements, deletion, eviction, and the multi-threaded sweep.Where each cache landed:
[node_db]cache_byteskey. Its resident size and bytes are reported inget_countsnext to the existing node byte counters.malloc_trim, sweeps accelerate to every 10 seconds with a warning, and it resets below 130%.API Impact
libxrplchange:TaggedCachegains aByteBudgetconstructor parameter andgetCacheBytes(); new[node_db]keycache_bytes; adminget_countsaddsnode_cache_sizeandnode_cache_bytes.Test Plan
GTest covers the byte budget holding through a burst of exactly-costed values with the sweep unable to fire, alongside the entry-cap and cap-disabled cases. Config, TaggedCache, SHAMapStore, and GetCounts suites pass. Draft until the perf-net soak confirms RSS stays under the budget while load climbs.