Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rating: Thread Rating: 53 votes, 5.00 average. Display Modes
Old 08-27-2008, 06:03 PM   #1
jonathanjong
Triple-A Player
 
Join Date: Feb 2007
Posts: 89
private/var/vm/

Some files in private/var/vm/ (e.g., sleepimage, swapfile1) seem to be taking oodles of space. Any idea what these are?

Also, how do I get rid of these printer files?
jonathanjong is offline   Reply With Quote
Old 08-27-2008, 06:42 PM   #2
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 32,409
The sleepimage file stores a copy of what is in RAM when your Mac goes into hibernation.
The swapfile1 file is the second of what can be a series of files (swapfile0, swapfile1,...)that are used for "virtual memory" - when your Mac needs more RAM than it actually has, some of the contents of RAM is temporarily swapped to these disk files. There is always at least the one swapfile0 file of size 64 MB.
__________________
hayne.net/macosx.html
hayne is offline   Reply With Quote
Old 08-28-2008, 07:56 PM   #3
jonathanjong
Triple-A Player
 
Join Date: Feb 2007
Posts: 89
So...I don't delete them? *smiles sheepishly*
jonathanjong is offline   Reply With Quote
Old 08-28-2008, 08:26 PM   #4
DeltaMac
League Commissioner
 
Join Date: Jan 2002
Posts: 8,500
You can choose to delete the sleepimage file, but it will be recreated when the system needs it. The swapfile is also created as needed. You might find multiple swapfiles. The system maintains those files automatically. There will always be at least one swapfile, as it is created when the system starts up. The swapfile(s) are cleared and reset at any restart.
So, it doesn't matter much if you delete those files yourself. Deleting a swapfile while the system is running (and using that swapfile) could result in strange behavior from your system, until you restart, and the swapfile is re-created.
DeltaMac is offline   Reply With Quote
Old 08-28-2008, 09:56 PM   #5
styrafome
Hall of Famer
 
Join Date: Nov 2004
Posts: 3,818
The most permanent way to prevent them is to install more RAM.

The other choice is to find a clever way to continually delete the swap files, but the price for that will probably be an endless cycle of crashes as the OS looks for stored RAM caches that are no longer there.
styrafome is offline   Reply With Quote
Old 08-28-2008, 10:07 PM   #6
Mikey-San
Hall of Famer
 
Join Date: Jan 2002
Posts: 3,541
Quote:
Originally Posted by styrafome
The most permanent way to prevent them is to install more RAM.

The other choice is to find a clever way to continually delete the swap files, but the price for that will probably be an endless cycle of crashes as the OS looks for stored RAM caches that are no longer there.

It's worth noting that by adding more RAM, you will increase the size of the sleep image. But more RAM is always good for performance. Storage space is cheap.
__________________
COMPUTER TYPE
SOME SPECIFICATIONS I COPIED FROM THE BOX
STUFF I INSTALLED ALL BY MYSELF
"WITTY QUOTE"
Mikey-San is offline   Reply With Quote
Old 08-28-2008, 11:24 PM   #7
JDV
Hall of Famer
 
Join Date: Sep 2004
Location: Chicago, Illinois
Posts: 3,191
I don't really think removing them is likely to result in more crashes; if the data being sought isn't found in a cache, it's simply retrieved from disk. If more virtual memory is needed, the OS will allocate another file. Even machines super-loaded with physical memory will still make use of caches (for reasons I don't exactly understand), but certainly that would reduce them.

Joe VanZandt
JDV is offline   Reply With Quote
Old 08-29-2008, 06:12 PM   #8
jonathanjong
Triple-A Player
 
Join Date: Feb 2007
Posts: 89
Ooh...OK then.
jonathanjong is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 06:22 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.