feat(runtime): configurable garbage collector, memory leak fix, regression test#1248
Open
zaccharyfavere wants to merge 1 commit into
Open
feat(runtime): configurable garbage collector, memory leak fix, regression test#1248zaccharyfavere wants to merge 1 commit into
zaccharyfavere wants to merge 1 commit into
Conversation
4d54c4d to
87ae2cf
Compare
bd1c802 to
f6071d4
Compare
4462a31 to
f9fb606
Compare
0b52b3b to
5dfb112
Compare
GC configuration - gcConfig lambda on SkipService, read each sweep via the SkipRuntime_callGCConfigProvider FFI bridge so the config can react to the environment in real time - fields: enabled, ttlMillis, maxGarbageSize, logsEnabled - defaults change: maxGarbageSize now caps the queue at 100 (previously unbounded, TTL-only). Services that don't provide gcConfig get this cap. - negative ttlMillis or maxGarbageSize disables the corresponding eviction criterion (never expires / unbounded) Memory leak fix - Context.reads is cleared at the end of each sweep; reads accumulated indefinitely otherwise, leaking memory. Metrics and tooling - getSkipPersistentSize exposed through the FFI chain as the memory metric - stress test (gc-stress.ts) with a linear-regression slope check - Makefile test-mem-stress target Notes - the instantiate-close-with-map sub-test fails on this branch alone; it requires the fix-deleteddir-leak PR for the DeletedDir cleanup, and passes once both are merged. Therefore, the stress test (gc-stress.ts) isn't automatically called by the CI yet because it would fail. I'll follow up to add that.
5dfb112 to
3ec9344
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.
Adds a configurable GC sweep mechanism for orphan reactive resources, exposes Skip persistent memory (from palloc.c) usage as a metric, fixes a separate memory leak in the reactive read tracking, and ships a regression test that detects future memory leaks.
GC configuration
SkipRuntime_callGCConfigProvider FFI bridge so the config can react to the
environment in real time
unbounded, TTL-only). Services that don't provide gcConfig get this cap.
criterion (never expires / unbounded)
Memory leak fix
indefinitely otherwise, leaking memory.
Metrics and tooling
Notes
it requires the fix-deleteddir-leak PR for the DeletedDir cleanup, and
passes once both are merged.
Therefore, the stress test (gc-stress.ts) isn't automatically called by
the CI yet because it would fail. I'll follow up to add that.