Sigar s = new Sigar();
try {
runall(i);
} catch (IllegalAccessException e) {
throw new SigarException(e.getMessage());
} catch (InvocationTargetException e) {
throw new SigarException(e.getMessage());
} finally {
s.close();
}
}
long totalTime = System.currentTimeMillis() - startTime;
proxy = null;
output("Running garbage collector..");
System.gc();
memstat(lastChange+1);
output(num + " iterations took " +
totalTime + "ms");
output("startSize=" + startSize +
", endSize=" + currentSize +
", diff=" + (currentSize - startSize));
}
else {
Object obj = invoke(new SigarInvoker(proxy, type), null, attr);
output(obj.toString());
}
}
else {
try {
runall(0);
} catch (IllegalAccessException e) {
throw new SigarException(e.getMessage());
} catch (InvocationTargetException e) {
throw new SigarException(e.getMessage());
}
}
}