[SOLVED] I still find column SWAP of `top` not zero when I `swapoff`
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I still find column SWAP of `top` not zero when I `swapoff`
In the same time, I note this on top of `top`
Swap: 0k total, 0k used, 0k free, 45540k cached
can any one explain it or provide some useful links ? Thanks.
yeah , you remind me of the page cache.And how about the SWAP column ,it is not displayed unless it is toggled
* P: SWAP = Swapped size (kb)
I get like this and figures are not zero in SWAP column after swapoff
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP
11961 luo 20 0 282m 21m 2248 S 1.2 4.2 4:08.42 261m
12098 luo 20 0 279m 26m 2348 S 0.0 5.2 2:35.71 253m
25849 luo 20 0 169m 26m 1368 S 0.0 5.4 1:53.30 142m
The SWAP column in top is useless/redundant information that has very little relationship to the amount of swap space used.
The SWAP column is just the VIRT column minus the RES column. A theory discussion based on the first virtual memory systems in the 1960s and 70s might explain that the swapped size is the virtual size minus the resident size. But memory management in real OSs is more complicated.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.