Skip to content

Incorrect virtual_available memory in Mac #81

@Simalexa

Description

@Simalexa

I noticed that virtual_available display incorrect information on Mac Ventura. I found a similar issue at dotnet/runtime#94846 and suggest chenge code in memory_darwin.cpp to
...
char const* mem_free_name = "kern.memorystatus_level";
uint32_t mem_free = 0;
size_t mem_free_length = sizeof( uint32_t );
if( sysctlbyname( mem_free_name, &mem_free, &mem_free_length, nullptr, 0 ) != -1 )
ret.virtual_available = mem_free * ret.virtual_total / 100;
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions