fix memory leak in cyclic object graphs, add non_root_count - #103
Open
shruti2522 wants to merge 2 commits into
Open
shruti2522 wants to merge 2 commits into
shruti2522 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
One or more issues must be addressed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds non-root reference counting to improve cycle collection in the branded mark-sweep collector.
Changes:
- Adds non-root counting and root classification.
- Adds traversal support for
Gcreferences. - Adjusts null trace handling.
File summaries
| File | Description |
|---|---|
| oscars/src/collectors/mark_sweep_branded/trace.rs | Updated as part of this pull request. |
| oscars/src/collectors/mark_sweep_branded/mod.rs | Updated as part of this pull request. |
| oscars/src/collectors/mark_sweep_branded/gc.rs | Updated as part of this pull request. |
| oscars/src/collectors/mark_sweep_branded/gc_box.rs | Updated as part of this pull request. |
Review details
Suppressed comments (1)
oscars/src/collectors/mark_sweep_branded/mod.rs:178
- The new liveness pass has no regression test for the failure mode named by this PR: the branded tests cover isolated allocations, roots, and ephemerons, but not two GC objects that point to each other. Add a test that creates a cycle and verifies it is reclaimed (for example through finalization or weak validity), including the container-nesting case this pass must support.
gc_box.non_root_count.set(0);
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| pub(crate) color: Cell<GcColor>, | ||
| /// Type-erased trace function. | ||
| pub(crate) trace_fn: TraceFn, | ||
| pub(crate) trace_non_roots_fn: unsafe fn(NonNull<u8>), |
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.
added
non_root_countto fix OOM memory leak occuring in the collector