github.com/moby/docker@v26.1.3+incompatible/pkg/meminfo/meminfo.go (about) 1 // Package meminfo provides utilites to retrieve memory statistics of 2 // the host system. 3 package meminfo 4 5 // Read retrieves memory statistics of the host system and returns a 6 // Memory type. It is only supported on Linux and Windows, and returns an 7 // error on other platforms. 8 func Read() (*Memory, error) { 9 return readMemInfo() 10 } 11 12 // Memory contains memory statistics of the host system. 13 type Memory struct { 14 // Total usable RAM (i.e. physical RAM minus a few reserved bits and the 15 // kernel binary code). 16 MemTotal int64 17 18 // Amount of free memory. 19 MemFree int64 20 21 // Total amount of swap space available. 22 SwapTotal int64 23 24 // Amount of swap space that is currently unused. 25 SwapFree int64 26 }