Commit Graph

13 Commits (d6702c96bd077aee178d5668a698608f0e9ac204)

Author SHA1 Message Date
Johan Walles dd875d4970 Fix memory stats on Darwin, non-CGO 9 years ago
Johan Walles 44f817eb8d Split mem_darwin.go into CGO and non CGO variants 9 years ago
Johan Walles 00504a37e3 Remove unused import 9 years ago
Johan Walles a6cd6f803b Use Go's built in syscall.Getpagesize() 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
Shirou WAKAYAMA 7288e9a5af common[all]: add internal 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
Myungjun Kim c5b94d3e4c memory[darwin]: return value of "sysctl hw.memsize" is memory size in bytes. 10 years ago
Shirou WAKAYAMA a9e65ec556 mem[darwin]: fix VirtualMem stat multiply. 10 years ago
Nikolay Sivko 06282a319c [darwin] hw.memsize already in bytes 10 years ago
若山史郎 cea341c690 mem: add 0 check to darwin.swapmem. 10 years ago
Shirou WAKAYAMA 13cd195a7e change package name. 10 years ago
Shirou WAKAYAMA a4671fcc2a move subdirectories. refer to issue #24 10 years ago