Skip to content

fix memory leak in cyclic object graphs, add non_root_count - #103

Open
shruti2522 wants to merge 2 commits into
boa-dev:mainfrom
shruti2522:fix-oom
Open

shruti2522 wants to merge 2 commits into
boa-dev:mainfrom
shruti2522:fix-oom

Conversation

@shruti2522

Copy link
Copy Markdown
Contributor

added non_root_count to fix OOM memory leak occuring in the collector

Copilot AI lite review requested due to automatic review settings September 11, 2026 16:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 Gc references.
  • 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.

Comment thread oscars/src/collectors/mark_sweep_branded/trace.rs Outdated
pub(crate) color: Cell<GcColor>,
/// Type-erased trace function.
pub(crate) trace_fn: TraceFn,
pub(crate) trace_non_roots_fn: unsafe fn(NonNull<u8>),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants