check that mem.share is valid

This commit is contained in:
Doug MacEachern 2007-10-24 00:19:01 +00:00
parent 26139ee50f
commit 2b39b1228e
1 changed files with 4 additions and 1 deletions

View File

@ -26,6 +26,7 @@ public class MultiProcMem extends ProcMem {
throws SigarException { throws SigarException {
ProcMem mem = new ProcMem(); ProcMem mem = new ProcMem();
mem.share = Sigar.FIELD_NOTIMPL;
long[] pids = ProcessFinder.find(sigar, query); long[] pids = ProcessFinder.find(sigar, query);
@ -33,8 +34,10 @@ public class MultiProcMem extends ProcMem {
ProcMem pmem = sigar.getProcMem(pids[i]); ProcMem pmem = sigar.getProcMem(pids[i]);
mem.size += pmem.size; mem.size += pmem.size;
mem.resident += pmem.resident; mem.resident += pmem.resident;
if (pmem.share != Sigar.FIELD_NOTIMPL) {
mem.share += pmem.share; mem.share += pmem.share;
} }
}
return mem; return mem;
} }