Problem
The 64 KiB minimum / 256 KiB default nursery makes allocation-heavy embedders collect far too frequently once they add safe mid-script minor-collection checkpoints. In zig-js object churn, that policy regressed the workload to roughly 2.53 s per 100 jobs because collector fixed costs dominated.
Proposed change
- Raise both the minimum and default nursery threshold to 4 MiB.
- Preserve the existing survival-based adaptive policy and young-batch growth cap.
- Keep the policy general in zig-gc; the embedder decides where safe collection checkpoints exist.
Evidence
A 4 MiB nursery was the best tested point for the downstream zig-js object-churn workload. Larger 8 MiB and 16 MiB batches were slower, while the old sub-megabyte defaults caused excessive minor collections.
Downstream: zig-utils/zig-js#63
Acceptance criteria
- Nursery threshold tests cover the new floor and adaptive cap.
- zig-gc unit tests pass.
- Downstream zig-js uses the policy at single-mutator safepoints.
- Exact downstream checksum remains stable.