Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Chiusa
#3,287 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #3299 di @sabtain05 — integrata
  • #3301 di @filzrev — integrata

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
53/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
performance

Direzione di ricerca

Read the macOS implementation in src/BenchmarkDotNet/Environments/PhysicalMemoryInfo.cs, especially the code that reads free pages and the vm_stat output. The issue points to host_statistics64 as the native API for obtaining VM statistics. Confirm which reusable pages should count as available, then compare the reported value with macOS benchmark results where possible; done means the available memory includes the relevant reusable pages.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When running benchmarks on macos(x64) CI environment.
Following CPU/Memory information is shown.

BenchmarkDotNet v0.16.0-ci, macOS Tahoe 26.6.1 (25G76) [Darwin 25.6.0]
Intel Core i7-8700B CPU 3.20GHz (Max: 3.19GHz) (Coffee Lake), 1 CPU, 4 logical and 4 physical cores
Memory: 14 GB Total, 0.44 GB Available

But, Memory: value(0.44 GB Available) looks like wrong value. (Compared to other envrionment benchmark results)

It seems current PhysicalMemoryInfo.cs implementation for macos gets free pages bytes only and other reusable pages bytes are ignored.

Other Considerations
It need to use host_statistics64 native API to get VMstats.

~~And currently page size is expected to be fixed value (4096). ~~
https://github.com/dotnet/BenchmarkDotNet/blob/61ebda8a50aea46484107c2f8d3e736cc31d15e5/src/BenchmarkDotNet/Environments/PhysicalMemoryInfo.cs#L139

But page size is different on arm64 environment(16384)
It need to get actual page size.

Ignore above comment. pageSize is overwritten by vm_stat parsed value. (It might be failed on localized environment thoght)

Lingua principale
C#
Stelle
11.5k
Fork
1.1k
Merge medio
2g 3h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dotnet/BenchmarkDotNet

Tutte le issue di dotnet/BenchmarkDotNet

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.