Commit Graph

6 Commits (e8f7a95747d711f34ddfe9dd9b825a84bd059dec)

Author SHA1 Message Date
Johan Walles 27093ae2d2 mem_darwin_test.go: Compare `total` to `sysctl hw.memsize` 9 years ago
Johan Walles 44f817eb8d Split mem_darwin.go into CGO and non CGO variants 9 years ago
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.
9 years ago
Johan Walles 5771ea9465 Add Darwin specific mem.VirtualMemory() tests 9 years ago
Shirou WAKAYAMA 202a805f46 mem[darwin]: fix printf verb. 10 years ago
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
10 years ago