alexcrichton opened PR #11789 from alexcrichton:more-pooling-allocator-metrics to bytecodealliance:main:
This commit adds a few more metrics to the
PoolingAllocatorMetricstype along the lines of accounting for more items as well as the unused slots in the pooling allocator. Notably the count of unused memory and table slots is exposed along with the number of bytes which are kept resident in these slots despite them not being in use. This involved a bit of plumbing to thread around the number of bytes that are actually kept resident to some more locations but is otherwise a pretty straightforward plumbing of accounting information we already had internally.<!--
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
-->
alexcrichton requested fitzgen for a review on PR #11789.
alexcrichton requested wasmtime-core-reviewers for a review on PR #11789.
pchickey submitted PR review.
pchickey created PR review comment:
I assume the cfg feature here vs at the use site is causing the current CI breakage
pchickey created PR review comment:
this needs cfg(feature = "gc"), and #[cfg(not(feature = "gc"))] 0
pchickey created PR review comment:
Looks like unnecessary
returnand;at end of this match block - the inner change should have been sufficient?
alexcrichton updated PR #11789.
lann created PR review comment:
I avoided this iteration + locking out of a (I guess probably irrational) fear of contention under heavy parallel load. Is that a pretty negligible concern here? If not, should we make a note about it in the pub method docs?
lann submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
I'll make a note yeah. My prediction is that it won't be too costly, but if it ends up causing problems we can probably work around it with atomic counters.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Oh this was needed due to the trailing impls/types/items after this so otherwise this wouldn't compile
alexcrichton updated PR #11789.
alexcrichton has enabled auto merge for PR #11789.
alexcrichton updated PR #11789.
alexcrichton has enabled auto merge for PR #11789.
alexcrichton updated PR #11789.
alexcrichton has enabled auto merge for PR #11789.
alexcrichton updated PR #11789.
alexcrichton merged PR #11789.
Last updated: Dec 06 2025 at 07:03 UTC