分析/proc/[pid]/maps中的各个内存区域的大小

cat maps | sed -e "s/([0-9a-f]{8})-([0-9a-f]{8})/0x1 0x2/" | awk '{printf("33[0;33m[%8d Page]33[0m 33[0;35m[%8d KB]33[0m %s
", (strtonum($2) - strtonum($1))/4096, (strtonum($2) - strtonum($1))/1024, $0)}'

  

原文地址:https://www.cnblogs.com/long123king/p/3770156.html