Query: sg_get_mem_stats
OS: debian
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
sg_get_mem_stats(3) Library Functions Manual sg_get_mem_stats(3)NAMEsg_get_mem_stats, sg_get_swap_stats - get VM statisticsSYNOPSIS#include <statgrab.h> sg_mem_stats *sg_get_mem_stats(void); sg_swap_stats *sg_get_swap_stats(void);DESCRIPTIONMemory statistics are accessed through the sg_get_mem_stats function. It returns a pointer to a static sg_mem_stats. The sg_get_swap_stats returns returns swap statistics. It returns a pointer to a static sg_swap_stats. On the FreeBSD operating system elevated privileges are required to access the swap statistics. Making the program setgid kmem should be sufficient. Programs running as root will not have this problem.RETURN VALUESThe VM system calls can return a pointer to either a sg_mem_stats or a sg_swap_stats. typedef struct{ long long total; long long free; long long used; long long cache; }sg_mem_stats; total The total amount of memory in bytes. free The total free memory in bytes. used The total used memory in bytes. cache The amount of cache used in bytes. typedef struct{ long long total; long long used; long long free; }sg_swap_stats; total The total swap space in bytes. used The used swap in bytes. free The free swap in bytes.TODOAdd a function to hold open the file descriptor to the kernel memory structures. Doing this would allow the elevated privileges to be dropped early on.SEE ALSOstatgrab(3)WEBSITEhttp://www.i-scream.org/libstatgrab/ i-scream $Date: 2005/04/25 11:25:45 $ sg_get_mem_stats(3)
Related Man Pages |
---|
sysinfo(2) - redhat |
sysinfo(2) - debian |
sg_get_disk_io_stats(3) - debian |
sg_get_network_io_stats(3) - debian |
sg_get_swap_stats(3) - debian |
Similar Topics in the Unix Linux Community |
---|
Opinions on memory increase |
Linux memory usage |
Anyone help to interpretate os statistics |
Help understanding how swap works |
Swap memory issue |