How can I get the total amount of memory / RAM connected to the system in Go? I want to use native code only if possible. I found a library that wraps the linux sysinfo command. Is there a more elegant way?
Besides runtime.MemStats, you can use gosigar to monitor system memory.
cgo and linux solution
package main // #include <unistd.h> import "C" func main() { println(C.sysconf(C._SC_PHYS_PAGES)*C.sysconf(C._SC_PAGE_SIZE), " bytes") }
Source: https://habr.com/ru/post/986466/More articles:Connect a single bluetooth device to multiple devices - c ++The difference between window.location.assign (url) and window.open (url, '_self) - javascriptXcode continues to forget imported Framework - iosHow to save a DATE field in Firebase using AngularFire - firebaseWhat is the difference between window.open (url) and window.location.href = url on Firefox? - javascriptConcave border - css3PHP Retrieving an Array with a Class as a Value - oopIs it appropriate to wrap each navigation element in a div? - htmlIs it possible to use span elements in div elements? - htmlHow to disable implicit constructor conversion, allowing copy-initialization - c ++All Articles