Skip to content

Fix available memory reporting on macOS - #3299

Merged
timcassell merged 2 commits into
dotnet:masterfrom
sabtain05:fix-macos-available-memory
Oct 22, 2026
Merged

timcassell merged 2 commits into
dotnet:masterfrom
sabtain05:fix-macos-available-memory

Conversation

@sabtain05

@sabtain05 sabtain05 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor
  • Include inactive and speculative pages when reporting available macOS memory.
  • Preserve the page size reported by vm_stat, including 16 KiB pages on Apple Silicon.
  • Add parser coverage for reusable pages and missing page data.

Fixes #3287. The previous implementation reported only Pages free, which understated available memory on macOS systems where reusable pages make up a substantial portion of memory.

@sabtain05

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

Comment thread src/BenchmarkDotNet/Environments/PhysicalMemoryInfo.cs Outdated
Comment thread src/BenchmarkDotNet/Environments/PhysicalMemoryInfo.cs Outdated
@sabtain05
sabtain05 force-pushed the fix-macos-available-memory branch from c0f6aed to 70bd9fa Compare October 19, 2026 10:27
Only "Pages free" is required; a missing page-size header falls back to
4096 bytes and missing inactive/speculative counts are treated as zero,
so a partial vm_stat output no longer drops the available value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@timcassell
timcassell merged commit 0fc0298 into dotnet:master Oct 22, 2026
11 checks passed
@timcassell timcassell added this to the v0.16.0 milestone Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The information displayed as available memory is inaccurate on macos/Linux

3 participants