Commit Graph

10 Commits (master)

Author SHA1 Message Date
Matthieu MOREL 9ce2ec161e chore: enable golangci-lint on Windows and MacOS
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 month ago
shirou bc060cc227 add SPDX License, remove old build tag, and replace import 10 months ago
mmorel-35 1e6b445a8a gofumpt 3 years ago
Shirou WAKAYAMA 57f6aebc7e add Timeout to invoke command and use common.Invoke refs: #201 9 years ago
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