fitzgen opened PR #13374 from fitzgen:instance-leak-on-oom to bytecodealliance:main:
Two things:
Reserve capacity in the instances map before allocating the instance to prevent OOM during push from leaking the instance.
Move
guard.run_deallocate = falseafterInstance::newsucceeds so that a failure inInstance::newproperly decrements the live instance count.<!--
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 pchickey for a review on PR #13374.
fitzgen requested wasmtime-core-reviewers for a review on PR #13374.
github-actions[bot] added the label wasmtime:api on PR #13374.
:thumbs_up: alexcrichton submitted PR review.
alexcrichton added PR #13374 Fix pooling allocator instance count leak on OOM during instantiation to the merge queue.
:check: alexcrichton merged PR #13374.
alexcrichton removed PR #13374 Fix pooling allocator instance count leak on OOM during instantiation from the merge queue.
Last updated: Jun 01 2026 at 09:49 UTC