Commit Graph

8 Commits

Author SHA1 Message Date
mmorel-35 1e6b445a8a gofumpt 2021-12-22 21:54:41 +00:00
Shirou WAKAYAMA 57f6aebc7e add Timeout to invoke command and use common.Invoke refs: #201 2016-05-20 17:59:41 +09:00
Johan Walles 27093ae2d2 mem_darwin_test.go: Compare `total` to `sysctl hw.memsize` 2016-02-22 07:28:55 +01:00
Johan Walles 44f817eb8d Split mem_darwin.go into CGO and non CGO variants 2016-02-20 21:49:23 +01:00
Johan Walles 13e00c76e4 Use OS calls rather than exec() to get memory statistics
Before this change we used to exec() various binaries to find out memory
information.

While this worked, it was awfully slow.

And if somebody would want to compute how many percent of available memory all
PIDs on the system uses, that would take almost ten seconds on my laptop with
the previous implementation.

This implementation fares a lot better, and is smaller.
2016-02-19 21:28:50 +01:00
Johan Walles 5771ea9465 Add Darwin specific mem.VirtualMemory() tests 2016-02-19 20:53:29 +01:00
Shirou WAKAYAMA 202a805f46 mem[darwin]: fix printf verb. 2015-10-14 15:59:10 +09:00
Cameron Sparr 4bba3025ca Use vm_stat command on darwin to get memory
This has the benefit of allowing us to also grab the cached memory so
that we can get an "available" measurement
2015-09-18 00:24:09 -07:00