vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Is there a way to empty the swap partition? I know it's handled by the system, but I had a program that terminated abruptly and left my swap full. I had to reboot to clear it out, which I wasn't too impressed with. If you're wondering, I was running PSAD and it was having a hard time with the amount of dropped SYN packets I was getting. -- lucas ------------------------- Perl Coder since 2001 shift || die; ------------------------- |
| |||
| On 2005-10-24, lucas <aolblowz@yahoo.com> wrote: > Is there a way to empty the swap partition? I know it's handled by the > system, but I had a program that terminated abruptly and left my swap full. > I had to reboot to clear it out, which I wasn't too impressed with. I have never heard of such a thing happening. I don't know if swapoff -a would work, but next time it happens give it a try. If it works, swapon -a would turn swap back on. --keith -- kkeller-usenet@wombat.san-francisco.ca.us (try just my userid to email me) AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom see X- headers for PGP signature information |
| |||
| Keith Keller wrote: > I have never heard of such a thing happening. I don't know if swapoff -a > would work, but next time it happens give it a try. If it works, > swapon -a would turn swap back on. > > --keith I had tried swapoff when it happened. It locked up the system. Regards, -- lucas ------------------------- Perl Coder since 2001 shift || die; ------------------------- |
| |||
| On Mon, 24 Oct 2005 19:54:25 -0400, lucas <aolblowz@yahoo.com> wrote: >Keith Keller wrote: >> I have never heard of such a thing happening. I don't know if swapoff -a >> would work, but next time it happens give it a try. If it works, >> swapon -a would turn swap back on. >I had tried swapoff when it happened. It locked up the system. In that case you were in the middle of a swap storm and impatient? Turning off swap appears to lock the system as it must search and discard stale (dead) memory in order to bring swapped out (live) memory back into core. During this process, the kernel should be given some alternative swap space, perhaps a swapfile ~16MB (wild guess) so that urgent allocations may be satisfied --> Example: some service needs > 4kB contiguous memory _now_, it wants to evict something quickly or die, eg. incoming net traffic data buffer. Grant. |
| |||
| Grant wrote: > On Mon, 24 Oct 2005 19:54:25 -0400, lucas <aolblowz@yahoo.com> wrote: > > In that case you were in the middle of a swap storm and impatient? > > Turning off swap appears to lock the system as it must search and > discard stale (dead) memory in order to bring swapped out (live) > memory back into core. > > During this process, the kernel should be given some alternative > swap space, perhaps a swapfile ~16MB (wild guess) so that urgent > allocations may be satisfied --> Example: some service needs > 4kB > contiguous memory _now_, it wants to evict something quickly or die, > eg. incoming net traffic data buffer. I had waited for the hard drive to settle down before I did that. But, next time this happens, I'll create a temporary swap file. Thanks for the idea. Regards, -- lucas ------------------------- Perl Coder since 2001 shift || die; ------------------------- |
| ||||
| lucas <aolblowz@yahoo.com> wrote: > Is there a way to empty the swap partition? Usually there is no need to "empty" the swap partition(s). Memory placed on swap is memory that is not being actively used by any program. If a program wants to use the memory again it will be read back to ram. To force all swap memory being read back to ram would only be a waste of ram which could be used for better things like disk cache. > I know it's handled by the system, but I had a program that terminated > abruptly and left my swap full. I had to reboot to clear it out, which I > wasn't too impressed with. If a program really dies it usually gives all of its memory back to the system. There is an exception to this rule, and that is programs using system V IPC. Those programs can leave memory used for interprocess communication which no program is responsible for giving back. Was your program really dead? If so, did it use system V ipc? If you want to clean up after such a program without a reboot you should read the manpages of ipcs and ipcrm. regards Henrik -- The address in the header is only to prevent spam. My real address is: hc7(at)uthyres.com Examples of addresses which go to spammers: root@variousus.net info@k-soft.se info@k-software.biz root@localhost |