Problem
GcCellBacking.addChunk requests a fixed 64 KiB chunk for the 128-byte Object size class while holding its internal allocator lock. That lock correctly blocks recursive allocation-failure collection, but under a 4 MiB Context limit it can leave usable headroom stranded: the exact dev.1818 recovery witness has 24,084 bytes remaining while every post-recovery Object allocation asks for 65,536 bytes and fails.
Fresh Linux evidence: CI unit shard 0 reaches the bounded-heap torn-object witness and fails after the pressure catch. Local allocation diagnostics reproduce fixed 65,536-byte denials with 22.9-24.7 KiB remaining. Moving Environment key allocation out of its trace-sensitive lock lets the script reach and catch these Object OOMs, but cannot make the fixed slab fit.
Required implementation
- Keep the normal 64/256/384 KiB size-class chunks for throughput when they fit.
- If the preferred chunk allocation fails, halve the slot count until the first smaller slot-aligned chunk fits, down to one cell. This bounded geometric search avoids an unbounded O(number-of-slots) OOM-probe loop while selecting the largest successful subdivision it probes.
- Allocate matching realm metadata transactionally; a failed chunk/metadata pair must publish nothing and leak nothing.
- Preserve exact ownership classification, free/published bitmaps, address ordering, relocation, trimming, batch allocation, and parallel locking for variable-length chunks.
- Do not raise the heap limit, delegate managed cells around
GcCellBacking, or special-case the test.
Acceptance
- A focused bounded allocator test proves preferred 64 KiB failure falls back to a smaller owned chunk and accounts/frees it exactly.
Context heap_limit_bytes never publishes a torn object under recovery pressurevalidates at least one complete post-recovery object under exact dev.1818, normal and TSan.- Cell-backing unit filters, full unit shard 0, and dependency audit pass without leaks.