119 Commits (v2.21.11)

Author SHA1 Message Date
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.
Ville Skyttä 09c3ba3896 [mem][solaris] simplify regular expressions
Ville Skyttä 093e68cb91 [mem][solaris] improve prtconf memory size scraping
Accept uppercase Memory, that's how it appears to be at least in Solaris
11.3 and OpenIndiana oi_151a7.
Ville Skyttä 768c3b1888 [mem][solaris] don't hardcode path to prtconf in error message
shirou 7ae41c1f40 [v2][solaris][mem] fix invoke ctx.
shirou 3e7da36a46 [mem][solaris] fix wrong variable name.
WAKAYAMA shirou 46d6fcc192 [mem][bsd] fix missing arg
shirou 582bb14d8a
[linux][mem] remove unnecessary import
Punya Biswal 32b14a3723 Use invoke.CommandWithContext
Punya Biswal 5169bfe02d
Update mem/mem_bsd.go
Co-authored-by: shirou <shirou.faw@gmail.com>
Punya Biswal 7c1aa06a5e Respond to review comments
* use LookPath for better error messages
* support procfs in containers
Tom Barker 84a665b712 Add mem.SwapDevices() method.
Guillaume Ballet 992d17af94 add support for OpenBSD arm64
Lomanic cd25417bd7 [mem][linux] Fix #1002 only try to parse /proc/meminfo numeric values on fields we're interested in
Lomanic 07887a9e9f [mem][linux] Add mocked test for VirtualMemory() and fix SReclaimable SUnreclaim retrieval
Lomanic 4cfc60d68b
Merge pull request #928 from Lomanic/skip-tests-when-not-implemented
Lomanic 84afaae670 [host][mem][process][openbsd] Add 386 const and types definitions
Continuation of #721, this type using mktypes.sh that I didn't know at the time.
Weirdly, `go tool cgo -godefs` doesn't produce propery go-fmt-ed code, had to do run go-fmt manually afterwards.
Lomanic 7f588ac380
Merge pull request #930 from tklauser/openbsd-uvmpexp
Use unix.SysctlUvmexp on OpenBSD
Tobias Klauser 62354ea032 Fix TestVirtual_memory on OpenBSD
On OpenBSD, the total is used + free + cached + inactive like on macOS.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Tobias Klauser aacbba22ae Use unix.SysctlUvmexp on OpenBSD
Use SysctlUvmexp from golang.org/x/sys/unix to avoid having to define
the type Uvmexp and the sysctl consts. This will also allow to build on
GOOS=openbsd with e.g. GOARCH=arm64.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Lomanic ea86cbc3ff [mem] Skip tests on non-implemented platforms #446
Simon Thoby 3b64944534 Set the 'free' memory value to the 'available' memory on windows
James Bebbington 61cb122a84
Added comment noting that PgMajFault is Linux specific
James Bebbington 16fdb92bfc Add pgmajfault to data returned by vmstat on Linux
GameXG 144c67833a
fix #863 Swap.UsedPercent is inconsistent
Xuewei Zhang 929068ccd5 mem: Add VirtualMemoryEx() and VirtualMemoryExWithContext()
Xuewei Zhang 3695635d09 Collect Active(anon), Inactive(anon) and Unevictable in /proc/meminfo
These fields helps people understand anonymous memory usage pattern.
lanixzcj 38b78c3eac rename InActive(file) to Inactive(file) in mem_linux.go
Minje Park b7f9acbce8 add unreclaim metric, this closes #719
Segflow 86c7289ccc Fix: use filename in exec.LookPath instead of full path
exec.LookPath searches for the file in the $PATH, which mean giving it an absolute path is against it's own purposes.
lootek 1cbb212a6b
Add pages in/out/fault statistics (as read from vmstat)
mingrammer 64a995aad4 Refactor with gofmt
mingrammer 017c9f9cbc Fix typos
WAKAYAMA shirou bb15c85289 [mem][freebsd]: add SysctlUint which can adapt both 32 and 64 bit
Lomanic e3c878cc43 [mem][darwin] Remove calls to sysctl binary in mem/mem_darwin.go #639
shirou 6c6abd6d16
Merge pull request #626 from mznet/manual-available-memory-calculation
Manual available memory calculation
Minje Park c75deb9dc0 debug codes were removed
Minje Park 47ed6aaebd activefile and inactivefile fields were removed from VirtualMemoryStat
shirou b3d992b0f6 [mem]freebsd: update xswdev_version to adapt FreeBSD 12.
Minje Park d23abede78 struct typo and broken test case were fixed
Minje Park d7ce61cac8 Error checks and fallback for old linux
Minje Park 9fb3b9625d mem available fallback under kernel 2.6.13
Minje Park 73545ec820 AvailableMemory is't calculated automatically under kenel 3.14 so it is needed to calcuate manually
manual available memory calculation should be done if only memavail is false

Manual Available Memory calculation under kernel 3.14

accurate manaul available memory calculation
Lomanic ccc1c1016b [mem][darwin] Fix #622 include Inactive memory in total calculation in TestVirtual_memory
Minje Park f9e238c38b SReclaimable should be added to Cached Memory
Isida Zyun'iti bd7b2f8148 Add mem(laundry) numbers on FreeBSD.
After FreeBSD 11.1, mem number of cached replaced by laundry.

https://reviews.freebsd.org/D8302
Isida Zyun'iti 48da6ade9e Fix FreeBSD total memory.
Like this.
FreeBSD: fix total memory giampaolo/psutil@bd9a58b bd9a58b2af
Lomanic 6b586d2fcd [mem][windows] Fix TestVirtual_memory test
shirou 6b48f3bd01 [mem] fix test.
Arnaud Rebillout 558a95bf02 Fix TestVirtual_memory #552
Based on https://stackoverflow.com/a/30772733/776208

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>