`ThreadState.stack` is a `Vec<Value<'gc>>` that the derived `Collect` impl traces in full. Slots between the live frames' top-of-stack and `stack.len()` may still hold last-call leftovers, which keeps those values reachable and prevents the GC from reclaiming them.
`src/env/thread.rs:40` flags this. Fix is a hand-written `Collect` impl that only traces slots up to the maximum live frame extent (or proactively clears slots when frames pop).
`ThreadState.stack` is a `Vec<Value<'gc>>` that the derived `Collect` impl traces in full. Slots between the live frames' top-of-stack and `stack.len()` may still hold last-call leftovers, which keeps those values reachable and prevents the GC from reclaiming them.
`src/env/thread.rs:40` flags this. Fix is a hand-written `Collect` impl that only traces slots up to the maximum live frame extent (or proactively clears slots when frames pop).