Commit Graph

22 Commits

Author SHA1 Message Date
mmorel-35 1e6b445a8a gofumpt 2021-12-22 21:54:41 +00:00
shirou 0969c9436b delete v2 directory, move v3 to top #1078 2021-11-30 23:47:59 +00:00
Tobias Klauser d935ecccea mem: use unix.SysctlUint64 for hw.memsize on darwin
Use unix.SysctlUint64 which directly returns an uint64 rather than
converting it from a string.
2021-11-15 10:26:08 +01:00
Tom Barker 84a665b712 Add mem.SwapDevices() method. 2021-08-19 10:16:30 -04:00
Lomanic e3c878cc43 [mem][darwin] Remove calls to sysctl binary in mem/mem_darwin.go #639 2019-03-02 23:22:53 +01:00
shirou 145dca90f7 change to use CommandContext. 2018-03-31 21:35:53 +09:00
shirou 4c73494c78 Add WithContext functions. 2017-12-31 15:25:49 +09:00
Sean Chittenden 635b971c0e
Move from the `syscall` package to the `golang.org/x/sys/{unix,windows}` 2017-06-02 13:51:00 -07:00
WAKAYAMA Shirou 1123132e5a [mem]darwin: swap memory was Kbytes, since linux is bytes. 2017-01-17 22:38:46 +09:00
Johan Walles dd875d4970 Fix memory stats on Darwin, non-CGO 2016-02-22 07:29:15 +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 00504a37e3 Remove unused import 2016-02-19 23:39:00 +01:00
Johan Walles a6cd6f803b Use Go's built in syscall.Getpagesize() 2016-02-19 23:37:43 +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
Shirou WAKAYAMA 7288e9a5af common[all]: add internal 2015-10-20 00:04:57 +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
Myungjun Kim c5b94d3e4c memory[darwin]: return value of "sysctl hw.memsize" is memory size in bytes. 2015-08-16 16:32:53 +09:00
Shirou WAKAYAMA a9e65ec556 mem[darwin]: fix VirtualMem stat multiply. 2015-07-23 11:39:22 +09:00
Nikolay Sivko 06282a319c [darwin] hw.memsize already in bytes 2015-04-08 14:53:21 +03:00
若山史郎 cea341c690 mem: add 0 check to darwin.swapmem. 2015-02-26 16:23:35 +09:00
Shirou WAKAYAMA 13cd195a7e change package name. 2014-12-30 22:09:05 +09:00
Shirou WAKAYAMA a4671fcc2a move subdirectories. refer to issue #24 2014-11-27 10:18:15 +09:00