Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: deleting swap files



At 11:52 AM -0700 6/20/01, Troy Goodson wrote:
I noticed that my free HD space was lower than usual and found that the culprit was the existence of several swap files:

-rw------T 1 root wheel 80000000 Jun 20 11:18 swapfile7
-rw------T 1 root wheel 80000000 Jun 19 14:34 swapfile6
-rw------T 1 root wheel 80000000 Jun 19 09:24 swapfile5
-rw------T 1 root wheel 80000000 Jun 18 15:40 swapfile4
-rw------T 1 root wheel 80000000 Jun 18 13:57 swapfile3
-rw------T 1 root wheel 80000000 Jun 18 13:55 swapfile2
-rw------T 1 root wheel 80000000 Jun 18 09:16 swapfile1
-rw------T 1 root wheel 80000000 Jun 16 11:26 swapfile0

Suspecting that I didn't really need all these swap files, I rebooted. Now, I'm back to one.

-rw------T 1 root wheel 80000000 Jun 20 11:39 swapfile0

Which leads me to these questions:

if Darwin isn't deleting unused swap files that's a bug, right?

Yes.

how do I know if a swap file is being used or not?

If it's there, it's used. The VM system removes unused swap files. There is no convenient means of determining "use" of a specific swap-file.

if I think unused swap files are laying around, is the best recourse to reboot?

I doubt that there is unused files on your system, but if you want to force a "garbage collection" process, rebooting is the only way I know of.

I doubt that I should delete a swap file, but I'll ask: how bad is that?

Theoretically, there should be no effect on on-going VM behavior. The file will be removed from the file systems directory, but the space will not be deallocated until the VM system is done with it. In practice, I think it would confuse the VM system's swap file management when unused files are deleted or there is an attempt to coalesce swap files. I haven't been brave enough to try it.

Given the amount of swap space represented by the directory listing above, I would suspect that you are either running every application you can find, or you have one or more memory leaks. The top utility can be helpful in determining memory usage.
--
Creed Erickson (mailto: email@hidden)
Deckhand, H.M.S. Beagle


References: 
 >deleting swap files (From: Troy Goodson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.