(SIGAR-188) implement mem actual free/used on AIX

This commit is contained in:
Doug MacEachern 2010-04-07 11:12:00 -07:00
parent d3acf798d5
commit 127099cd34
1 changed files with 4 additions and 2 deletions

View File

@ -243,18 +243,20 @@ int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem)
{ {
int status; int status;
perfstat_memory_total_t minfo; perfstat_memory_total_t minfo;
sigar_uint64_t kern;
if (sigar_perfstat_memory(&minfo) == 1) { if (sigar_perfstat_memory(&minfo) == 1) {
mem->total = PAGESHIFT(minfo.real_total); mem->total = PAGESHIFT(minfo.real_total);
mem->free = PAGESHIFT(minfo.real_free); mem->free = PAGESHIFT(minfo.real_free);
kern = PAGESHIFT(minfo.numperm); /* number of pages in file cache */
} }
else { else {
return errno; return errno;
} }
mem->used = mem->total - mem->free; mem->used = mem->total - mem->free;
mem->actual_used = mem->used; mem->actual_used = mem->used - kern;
mem->actual_free = mem->free; mem->actual_free = mem->free + kern;
sigar_mem_calc_ram(sigar, mem); sigar_mem_calc_ram(sigar, mem);