Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the '10.3: Slightly easier (or more effective) way...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Slightly easier (or more effective) way...
Authored by: srobart on Dec 15, '03 03:28:27PM

The easiest way I've found to delete the nasty swap files is to go into the terminal, su to root and type in "rm -rf /private/var/vm/*" (without the " obviously).
I've regained more than a gigabyte of space on my HD by doing that, unfortunately, it must be done every time your computer makes a new swap file. I just leave a terminal window open with the command in the window and hit the up key to recall the command, then hit enter.

[ Reply to This | # ]
10.3: Slightly easier (or more effective) way...
Authored by: babbage on Dec 15, '03 05:02:54PM

Uhh, don't do that. Just don't do that. You're deleting the memory contents of currently running programs. Those vm files aren't just debris, they actively represent data your system is trying to keep track of.

If you want to restrict the growth of VM usage, avoid running many programs simultaneously. If you can do so, try to keep a few GB of disc free so that swap consumption can grow naturally. Or if you want to spend some money, bulk up on RAM &/or get a bigger hard drive. Any of these will help with swap & disc space issues.

The details of Panther handles virtual memory may be different from how it was done in Jaguar & earlier, but the general idea isn't any different from how it has always been: if you are trying to have the system keep track of more data than you have physical memory, it will start swapping data out to swap files. If you have a lot of ram, the ceiling is higher before you start having to swap. If you have a lot of free disc space, you have a more comfortable buffer before problems start coming up.

But if you just start nuking swap files willy nilly, you're just begging for things to start going wrong. Please don't recommend that people do this, it's the wrong way to solve the problem.

(Alternatively, it would be nice if Apple had a utility -- preferably an automatic one -- that tried to reduce the growth of the VM size. This may be something that can be figured out by examining the open source Darwin core, but I've never looked into it. I'd assume that they already do some things to manage VM, but maybe other tools would be useful. However, it is very safe to say that sudo rm /var/vm/* is not a responsible or productive way to go about this.


[ Reply to This | # ]

10.3: Slightly easier (or more effective) way...
Authored by: ajoakland on Dec 15, '03 11:28:39PM

Actually, this is probably NOT a problem, because, in unix, once a file is open, and it is being accessed, you really don't delete it or free it up until it is closed by the program using it. This is a common unix problem with trying to delete evergrowing log files. Even when you rm the file, you don't regain space until the programing using it closes it. Now I am assuming that a VM file would not be closed until the OS was done with it. Also the fact that the user who did this continued being able to work with no problems, adds some credence to the contents not really being lost.

[ Reply to This | # ]
Trashing swap can have deleterious effects.
Authored by: macmath on Dec 16, '03 03:05:31PM

I was trying out some utility which offered to trash swap. I incorrectly assumed that it would not trash something in use, and let it do so. But it trashed all the swapfiles anyway. The computer locked-up after a bit. The swapfiles should not be trashed by the user. Panther will give back swapfiles itself sometimes, however.

[ Reply to This | # ]