Today’s article will be nice and easy, as we cover just a couple of ways to monitor swap usage. There are several ways to monitor swap usage, so we’ll just cover a couple of them. One of ’em is bound to work.
So, this only applies to those people who use swap. If you use the search feature, you’ll see that I’ve addressed this before and that I tend to use swap – because it’s more than just a place the kernel sticks stuff when you’ve run out of RAM.
As you can see, on a system with plenty of RAM – and plenty of free RAM – the system still uses swap. I figure that the kernel is smarter than I am. You do you, but I will continue using swap.
But, enough about that. If you don’t use swap, just accept that this article isn’t meant for you and move along. Tomorrow’s article might just have something useful for you. You never know!
So then, I will assume readers know enough about what swap is and will have made their own choices. This article is for those who want to monitor swap usage.
Let’s Monitor Swap Usage:
You guessed it. You’re going to need an open terminal. So, open your favorite terminal emulator. If you don’t know how to open the terminal, you can do so with your keyboard – just press
With your terminal now open, you can try the following command:
1 | free -m |
(You can just use ‘free
‘ but the -m
flag makes it easier to read. You can also use ‘free -h
‘ if you prefer that output.)
That command should be fairly universal. You can also use the following command if you’d prefer. It’s just:
1 | swapon --summary |
That command is pretty handy and pretty much is the same as you’d get if you just run’cat /proc/swaps
‘ which is, I suppose, yet another way for you to monitor swap usage. Think of it as a bonus way to check swap usage. After all, you can’t have too many ways and one of ’em is bound to stick with you if you use it often enough.
Closure:
And there you have it. You have another article. This time, we’ve discussed how to monitor swap usage (in the terminal, of course). It’s a handy tool for those who do use swap (be it partition or swapfile). If you don’t use swap, you probably won’t get much use from this article. Maybe tomorrow will be more interesting for you?
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.