public class MemWatch {
static final int SLEEP_TIME = 1000 * 10;
public static void main(String[] args) throws Exception {
Sigar sigar = new Sigar();
if (args.length != 1) {
throw new Exception("Usage: MemWatch pid");
}
long pid = Long.parseLong(args[0]);
long lastTime = System.currentTimeMillis();
ProcMem last = sigar.getProcMem(pid);
while (true) {
ProcMem cur = sigar.getProcMem(pid);
StringBuffer diff = diff(last, cur);
if (diff.length() == 0) {
System.out.println("no change " +