PDA

View Full Version : SwapFiles....how can i delete?


beatle888
Feb 14, 2003, 08:11 PM
hello. i heard that swapfiles can slow your
system down if they accumulate. and what
i was wondering was...is there a way to delete
the swap files....say after i close photoshop?
i know i can restart but thats sorta anti osx :D


thanks for your help.

Vector
Feb 14, 2003, 09:17 PM
the swap file can be found in (your hard drive)>Private>var>vm

It is in an invisible directory so you will either have to make all of your files visible, or delete it directly from the terminal.

You can also find it by pressing command-f in the finder then type 'swap' in the search window and under the add criteria droplist choose visibility and select all. Then press search and it should give you the swap file probably named 'swapfile0'.

As the file is only available to the root user, you will have to delete it using the sudo command in the terminal or by using an app like Force Delete.

beatle888
Feb 14, 2003, 09:50 PM
so if after having a lot of applications open
and i have like four swap files, it would be
safe to trash the files after closing all of the
applications?

wouldnt that be like restarting in a sense...i would just be purging the vm's. but without
the hassle of restarting. its strange how these
swap files doent delete themselves. anyway
im gonna check out Force Delete..thanks alot.

:)

Bear
Feb 15, 2003, 04:45 AM
Originally posted by beatle888
so if after having a lot of applications open
and i have like four swap files, it would be
safe to trash the files after closing all of the
applications?
No, it isn't safe to delete these files, not if the files are in active use. Which they could be, even if the system in question has no user applications running.

Do not force delete them. This only leads to problems. And do you really have more than one swap file sitting around?

And even if you delete the files, don't be surprised if you don't get the diskspace back until you reboot the system.

One experiment to try if you have more than one swapfile is to reboot the system and see how many you have after the reboot. If it is only one (or none), you're better off letting Mac OS manage the swapfiles.

beatle888
Feb 15, 2003, 08:05 PM
hello, i have five hundred and twelve megs of
ram on my ti. i usually have about four or five
swap disks after pushing around some
photoshop files. this is not uncommen
condisdering photoshop requires five times the
amount of ram as the file size. obviously one
might need to use scratch disk space. sooooo
after awhile i do tend to have atleast four swap
files....but the system NEVER deletes them,
even after i quit all applications and just let it
sit there. :( it sucks, i dont want to have to
restart my system just to clear the swap files.

AND supposedly having a lot of swap files slows
your computer down.

so are you saying that i shouldnt have more
then one swap file? thats strange, i hope that
nothings wrong with my system. i guess i'll
stop throwing the away.

Bear
Feb 16, 2003, 08:00 AM
[i]...

so are you saying that i shouldnt have more
then one swap file? thats strange, i hope that
nothings wrong with my system. i guess i'll
stop throwing the away. [/B]
Do the number of swapfiles get reduced after restarting the system? I just went through the OS X startup scripts, and it does remove the old swapfiles when the system starts up.

If so, that's your answer, let the system manage the swapfiles itself.

Where a person needs a lot of swap space, then partitioning the disk to have a swap partition of the right size would be a good idea.

yuri_koval
Feb 16, 2003, 08:27 AM
How about changing the size of a swap space allowed to use ?

can you do that :confused:

Bear
Feb 16, 2003, 08:34 AM
Originally posted by yuri_koval
How about changing the size of a swap space allowed to use ?

can you do that :confused:
Looking at the startup scripts, it looks like it is possible, but if you edit the script and mess it up, you're going to have problems.

So be careful if you try it. I have no idea what the effect of changing the parameters for the swapping/swapfiles is, so I am not going to give directions for changes.

beatle888
Feb 16, 2003, 02:46 PM
Originally posted by Bear

Do the number of swapfiles get reduced after restarting the system?



yes but i dont want to have to restart just
to regain performance from my system.
i was told when these files add up it slows
performance. oh well, i can deal.

thanks for your reply.

Bear
Feb 16, 2003, 03:23 PM
Originally posted by beatle888




yes but i dont want to have to restart just
to regain performance from my system.
i was told when these files add up it slows
performance. oh well, i can deal.

thanks for your reply.
Look at it this way...

If you're causing that many swapfiles to be generated, the odds are you're going to be doing the same thing again later. So removing them would be a waste of your time and the system would have to regenerate them.

Leave them be. :D

rainman::|:|
Feb 16, 2003, 03:56 PM
Bear's right, just leave them alone. If you really want, you can move them to another disk/partition to keep defragmenting to a minimun (some say that putting them on another disk speeds performance, it hasn't made too much different on my system). You cannot change how much space swapfiles use, but you can change the location of them.

Here's the short, sweet answer. If you don't want swap files, go buy a lot more RAM. Swap files are used only when there's not enough physical RAM to handle everything. The performance loss comes from simply using swap files, not having them on your disk later--

deleting them may actually cause performance problems, as the system has to run through the commands used to create the files every time you delete them. And if the swapfiles are being used even a tiny bit, you won't know it, and deleting them could cause some massive problems in any programs running--

pnw