Documentation ¶
Overview ¶
Package memory provides sanatized information about for Linux Memory - http://superuser.com/questions/521551/cat-proc-meminfo-what-do-all-those-numbers-mean - https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s2-proc-meminfo.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Memory ¶
type Memory struct { // Unit is the metric used for all the numbers returned. E.g. kb, mb, gb. Unit string // Physical memory statistics of the machine. Physical struct { // Total is the total physical memory of the system. Total int64 // Free is the free physical memory in the system. Free int64 // Used physical memory of the system. Used int64 // Cached is the physical memory that is used for cache. Cached int64 // Buffers is the amount of memory used for file buffers. Buffers int64 // TotalFree is Free memory + Used + Cached which is the real // amount of memory that Linux has available TotalFree int64 } // Swap is information on swap usage on the system. Swap struct { // Total swap that is available. Total int64 // Free swap space. Free int64 // Used swap space. Used int64 // Cached is space used for cache Cached int64 } // Virtual is the virtual memory used by the machine. Virtual struct { // Total virtual memory that has been allocated. Total int64 // Used virtual memory. Used int64 // Chunk is the largest chunk that is being used. Chunk int64 } // Dirty is the memory waiting to be written back to disk. Dirty int64 // Writeback is the memory currently being written back to disk. Writeback int64 // Mapped is memory used my mmap files. Mapped int64 }
Memory returns the memory usage of the system.
type ProcessMemory ¶
type ProcessMemory struct { // Swap usage of the Process Swap struct { // Size of the swap used Size int64 // Unit metric used Unit string } }
ProcessMemory returns memory usage of a Process
func NewProcess ¶
func NewProcess(proc procfs.Proc) *ProcessMemory
NewProcess returns memory information of a Linux Process
Click to show internal directories.
Click to hide internal directories.