fitzgen opened PR #13278 from fitzgen:issue-13263 to bytecodealliance:main:
With a GC zeal allocation counter of
1, we would otherwise indefinitely fail to allocate, even after we did the GC that the counter triggered, when we tried to allocate again the GC zeal counter would force-return another OOM.Instead, we temporarily disable the GC zeal allocation counter in
retry_after_gc_asyncon the retry path. This resets the counter after we have done our second-attempt allocation, giving the desired sequence of events forgc_zeal_alloc_counter=1where we GC once on everyretry_after_gc_asynccall:
- Attempt to allocate
- Fails with GC OOM due to
gc_zeal_alloc_countergoing from1to0gc_zeal_alloc_counterreset to1- Disable
gc_zeal_alloc_counter- Do GC-or-growth
- Retry allocation
- Succeeds or fails without interference from the
gc_zeal_alloc_counter- Re-enable
gc_zeal_alloc_counter=1so everything repeats on the nextretry_after_gc_asynccallFixes https://github.com/bytecodealliance/wasmtime/issues/13263
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
fitzgen requested alexcrichton for a review on PR #13278.
fitzgen requested wasmtime-core-reviewers for a review on PR #13278.
:thumbs_up: alexcrichton submitted PR review.
fitzgen added PR #13278 Disable GC zeal allocation counter when retrying after GC to the merge queue.
:check: fitzgen merged PR #13278.
fitzgen removed PR #13278 Disable GC zeal allocation counter when retrying after GC from the merge queue.
Last updated: Jun 01 2026 at 09:49 UTC