gopsutil icon indicating copy to clipboard operation
gopsutil copied to clipboard

Swap memory values for Mac

Open ssdittak opened this issue 3 years ago • 1 comments

https://github.com/shirou/gopsutil/blob/6918006d351cdca8e725243abf3e10a9968771ce/mem/mem.go#L81

I always get 0 values for Swap on Mac (even if I run as root) when I try to run open-telemetry collector which references gopsutil for paging related metrics: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/hostmetricsreceiver/internal/scraper/pagingscraper/paging_scraper_others.go

Is this expected or am I missing something?

ssdittak avatar Jan 24 '22 11:01 ssdittak

That depends, what's the result of sysctl vm.swapusage (see https://github.com/shirou/gopsutil/blob/6918006d351cdca8e725243abf3e10a9968771ce/mem/mem_darwin.go#L41)?

If your host is not under huge load, I guess it won't swap

Lomanic avatar May 16 '22 23:05 Lomanic