Re: Why would top show the processes are using swap when there is no swap space?
- From: "jinzishuai@xxxxxxxxx" <jinzishuai@xxxxxxxxx>
- Date: 23 Mar 2007 11:31:10 -0700
Thank you both.
I am 100% sure that there is no swap space used. The /proc/swaps file
is empty and free shows 0 for swap also.
I think Floyd's idea about the code may be the case.
There are times that when I recompiled the running code, the running
code crashed.
This shouldn't happen if the whole code is loaded into the RAM at the
beginning.
But if it is as described "swapped out", then deleting the binary file
on disk would make the swap in impossible and thus I got a crash.
Thank you very much.
Shi
I'm not sure if this is what you are seeing... but not all
virtual memory is RAM or SWAP! The only thing written to actual
swap space is data, not program code.
An ELF executable binary has code pages that are non-writeable
and can be shared between different processes. That means the
disk file can be, and is, used instead of swap space. When
program code is "swapped out", the RAM is merely marked as
available, but nothing is saved to disk because it is already on
disk. If part of it needs to be paged in it is read from the
original executable binary file, not from you swap space.
I don't know if it works this way, but if the program code for
your above program takes up 2164K, and only 1144K has been paged
in, it probably will show 1020K as in "SWAP".
--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) f...@xxxxxxxxxx
.
- Follow-Ups:
- Re: Why would top show the processes are using swap when there is no swap space?
- From: Floyd L. Davidson
- Re: Why would top show the processes are using swap when there is no swap space?
- From: Bill Marcum
- Re: Why would top show the processes are using swap when there is no swap space?
- References:
- Why would top show the processes are using swap when there is no swap space?
- From: jinzishuai@xxxxxxxxx
- Re: Why would top show the processes are using swap when there is no swap space?
- From: Floyd L. Davidson
- Why would top show the processes are using swap when there is no swap space?
- Prev by Date: Screen saver in text mode don't work
- Next by Date: Re: ext3 File System Performance Issue
- Previous by thread: Re: Why would top show the processes are using swap when there is no swap space?
- Next by thread: Re: Why would top show the processes are using swap when there is no swap space?
- Index(es):
Relevant Pages
|