From 62791c29f9c35b93660c23e7025b88c94c51fe48 Mon Sep 17 00:00:00 2001 From: noctarius aka Christoph Engelbert Date: Mon, 14 Aug 2023 14:03:51 +0200 Subject: [PATCH] syscall.Sysinfo returns an uint32 on linux/arm, but uint64 otherwise --- procstats/linux/memory_linux.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/procstats/linux/memory_linux.go b/procstats/linux/memory_linux.go index 0660af7..3ea460a 100644 --- a/procstats/linux/memory_linux.go +++ b/procstats/linux/memory_linux.go @@ -57,7 +57,8 @@ func readSysinfoMemoryLimit() (limit uint64, err error) { var sysinfo syscall.Sysinfo_t if err = syscall.Sysinfo(&sysinfo); err == nil { - limit = uint64(sysinfo.Unit) * sysinfo.Totalram + // syscall.Sysinfo returns an uint32 on linux/arm, but uint64 otherwise + limit = uint64(sysinfo.Unit) * uint64(sysinfo.Totalram) } return