FFORGE//RS
← Roadmap

rust / LEVEL 4

The registry that kept every request alive

EST.40 MIN
01

THEORY / RETRIEVAL

What to restore

  • Distinguish memory safety from bounded object lifetime
  • Replace accidental Arc ownership with Weak references
  • Prune dead entries while preserving live registration order

Safe Rust can still retain memory forever

The borrow checker prevents use-after-free, not logical retention. An Arc clone in a registry is another owner, so request state remains live until that registry releases it. RSS alone is weak evidence because allocators may retain pages; a retained-object path or strong-count invariant is more direct.

Weak expresses observation without ownership

Arc::downgrade creates a Weak pointer that does not keep the value alive. Weak::upgrade returns Option<Arc<T>>, forcing the observer to handle an object that disappeared. Dead slots still need bounded cleanup so the registry itself does not grow without limit.

CHECKPOINT

Request traffic returns to zero, but a diagnostic registry keeps growing. Which evidence most directly proves logical retention rather than allocator page reuse?

ISOLATED RUST 1.96
src/lib.rsEDIT

02 / PROFILING

Read the profile and fix the cause

Repair Registry so registration never becomes ownership. live_ids must return live contexts in registration order and prune every dead Weak slot. Keep the public API and use no unsafe code or global state.

Initializing editor…
CLOUD SANDBOXnetwork off · 256 MB · 12 s
1 / 64 KB
OUTPUT
Runner is waiting for a submission.