!7 p { int processID = nempty(args) ? parseInt(first(args)) : processID_int(); S text = loadTextFile("/proc/" + processID + "/smaps"); S range = null; new TreeMap rssByRange; for (S s : lines(text)) { S addr = regexpFirstGroupIC("^([0-9a-f]{1,16})-", s); if (addr != null) { addr = lpad(addr, 16, '0'); print("Have address: " + addr); range = takeFirst(/*7*/6, addr); continue; } // else print("Not range: " + s); PairS p = parseColonProperty(s); if (eqic(pairA(p), "rss")) { long size = parseFirstLong(p.b); if (size != 0) rssByRange.put(range, getOrCreate_long(rssByRange, range) + size); } } //pnl(rssByRange); for (unpair S _range, long size : mapToPairs(rssByRange)) { print("Address range " + rpad(_range, 16, 'x') + ": " + toK(size) + " MB"); } long actualSize = longSum(values(rssByRange)) - toLong(rssByRange.get("000007")) - toLong(rssByRange.get("00000b")) - toLong(rssByRange.get("000013")); print("Actual process size: " + toK(actualSize) + " MB"); }