man sysinfo

return information on overall system statistics;

#include <sys/sysinfo.h>

int sysinfo(struct sysinfo *info);

struct sysinfo{

long uptime;

......

unsigned long totalram;//Total useable main memorysize

unsigned long freeram;//Available memory size(可用页的个数)

  ......

};


usage:

struct sysinfo aa;

sysinfo(&aa);

printf(...,aa.freeram);

阅读更多
文章标签: sysinfolinux
个人分类: LINUX
上一篇有关huage_page的使用(去除huage_page功能)tilepro
下一篇pthread_cond_timewait pthread_cond_wait
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭