Show /proc memory maps

Total virtual memory size of a process from smaps

cat /proc/<pid>/smaps | awk '/^Size/{sum+=$2} END{print sum/1024" MB"}'

tool
linux133 commands
tags
linuxmemorydebug

More linux commands

  • grep -E 'HugePages|AnonHugePages|Transparent' /proc/meminfo

    Check if THP / hugepages are used and configured

  • echo never > /sys/kernel/mm/transparent_hugepage/enabled

    Disable THP at runtime (fix for Redis, MongoDB latency spikes)

  • numactl --hardware

    NUMA nodes, CPU assignment, and memory distribution

  • sysctl -w net.core.somaxconn=65535 net.ipv4.tcp_max_syn_backlog=65535

    Increase socket listen backlog for high-connection services

  • sysctl -w net.core.default_qdisc=fq net.ipv4.tcp_congestion_control=bbr

    Enable Google BBR congestion control for better throughput

all 133 linux commands