From 2b39b1228eab1ec0d5eec367dd4c0012e6b5c658 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 24 Oct 2007 00:19:01 +0000 Subject: [PATCH] check that mem.share is valid --- bindings/java/src/org/hyperic/sigar/MultiProcMem.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bindings/java/src/org/hyperic/sigar/MultiProcMem.java b/bindings/java/src/org/hyperic/sigar/MultiProcMem.java index a95b68e7..1b68f12b 100644 --- a/bindings/java/src/org/hyperic/sigar/MultiProcMem.java +++ b/bindings/java/src/org/hyperic/sigar/MultiProcMem.java @@ -26,6 +26,7 @@ public class MultiProcMem extends ProcMem { throws SigarException { ProcMem mem = new ProcMem(); + mem.share = Sigar.FIELD_NOTIMPL; long[] pids = ProcessFinder.find(sigar, query); @@ -33,7 +34,9 @@ public class MultiProcMem extends ProcMem { ProcMem pmem = sigar.getProcMem(pids[i]); mem.size += pmem.size; mem.resident += pmem.resident; - mem.share += pmem.share; + if (pmem.share != Sigar.FIELD_NOTIMPL) { + mem.share += pmem.share; + } } return mem;