Finding and Trimming Linux Bloat
Analyzing Linux Memory
I ate way too much pizza tonight. I know I'll be sorry tomorrow morning when I step on the scale. That darn scale tells me right off if I'm getting bloated.
It should be just as easy with programs, right? If you're running on a low-memory system -- and these days, anything with less than two gigabytes qualifies as low-memory -- it would be handy to know which programs have been spending a little too much at the pizza and ice cream joints and not enough time at the gym.
Unfortunately, memory on Linux isn't as easy as that single number the bathroom scale gives you. So let's take a look and see what information is available.
The tool that's closest to your bathroom scale is gmemusage (Figure 1).
It's a really nifty tool that gives you an overview of where all the memory is going on your system.
It's generally not installed by default, but most major Linux distros offer it as a package. Unfortunately, Ubuntu Jaunty user have a complication: there's a package you can install, but it doesn't work. Check out Ubuntu bug 370735 for various fixes.
gmemusage shows you your memory graphically, so you can see at a glance where the hogs are. The colors are a bit garish and sometimes hard to read, but if you use the program a lot you can configure it with your choice of colors and fonts (see the man page).
While gmemusage is great for getting a quick overview of memory,
you shouldn't put too much faith in the absolute numbers reported
there, because there are a lot of different ways to look at memory
use on a Linux machine.
- 1Linux Top 3: Fedora 24, Peppermint 7 and Solus 1.2
- 2Linux Top 3: Alpine Linux 3.4, deepin 15.2 and Linux Lite 3.0
- 3Linux 4.7 Set to Boost Live Patching, Security and Power Management
- 4Linux 4.6 Charred Weasel adds USB 3.1 Support
- 5Linux Top 3: OpenIndiana 2016.04, Ubuntu 16.04 and Debian's New Leader