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

This commit is contained in:
Doug MacEachern 2010-04-07 13:23:58 -07:00
parent 127099cd34
commit 7f4a3a3fd4
1 changed files with 8 additions and 2 deletions

View File

@ -75,7 +75,9 @@ char *sigar_os_error_string(sigar_t *sigar, int err)
int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem)
{
struct pst_dynamic stats;
struct pst_vminfo vminfo;
sigar_uint64_t pagesize = sigar->pstatic.page_size;
sigar_uint64_t kern;
mem->total = sigar->pstatic.physical_memory * pagesize;
@ -84,8 +86,12 @@ int sigar_mem_get(sigar_t *sigar, sigar_mem_t *mem)
mem->free = stats.psd_free * pagesize;
mem->used = mem->total - mem->free;
mem->actual_free = mem->free;
mem->actual_used = mem->used;
pstat_getvminfo(&vminfo, sizeof(vminfo), 1, 0);
/* "kernel dynamic memory" */
kern = vminfo.psv_kern_dynmem * pagesize;
mem->actual_free = mem->free + kern;
mem->actual_used = mem->used - kern;
sigar_mem_calc_ram(sigar, mem);