Stop guessing which socket is hogging your memory

Networking & Firewall (Ss/Netstat/Iptables/Nftables/Curl)

Stop guessing which socket is hogging your memory

🧩 The Challenge

Dealing with a service that suddenly climbs in memory usage and you can’t figure out if it’s the application or a pile of hung network connections is a nightmare. I spent half a Saturday chasing a ghost leak once only to find thousands of sockets stuck in CLOSE_WAIT.

💡 The Fix

Use the memory usage flag in ss to print the actual memory buffers associated with each socket. It lets you see exactly which connections are eating your RAM without needing to restart the process.

ss -t -a -m

⚙️ Why It Works

Adding the -m flag forces the kernel to dump the memory usage for the socket’s send and receive buffers right into your terminal output. It makes the bloated connections stand out immediately compared to the healthy ones.

🚀 Pro-Tip: Pipe it into sort -k 5 -n to bubble the biggest memory hogs right to the top of your screen.

Linux Tips & Tricks | © ngelinux.com | 10/14/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted