The conversation on this page has been archived and is no longer active.

What is SleepImage

Message #1 - Posted 2009/02/14 - Pluto

I am short of space on my HD and find I have a huge 2GB file called "SleepImage" in the private/var/vm/ folder.

What is this file, and can I get rid of it?

Anyone?

Message #2 - Posted 2009/02/14 - Tim Lance

On Sat, 14 Feb 2009 06:08:44 -0600, Pluto wrote (in a previous article):

I am short of space on my HD and find I have a huge 2GB file called "SleepImage" in the private/var/vm/ folder.

What is this file, and can I get rid of it?

Anyone?

Is OK to judiciously crosspost. In this case you could have highlighted the two groups' names and then created the a new message.

--

Tim
lance_1012@hotmail.com

Message #3 - Posted 2009/02/15 - Chris Ridd

On 2009-02-14 12:08:44 +0000, Pluto said:

I am short of space on my HD and find I have a huge 2GB file called "SleepImage" in the private/var/vm/ folder.

It is the space the OS uses to write the contents of RAM when the machine's in "safe sleep", ie the one which uses no current. I noticed it while reading <http://support.apple.com/kb/HT1490>:

---
Tip: When the battery reaches "empty", the computer is forced into sleep mode. The battery actually keeps back a reserve beyond "empty", to maintain the computer in sleep for a period of time. Once the battery is truly exhausted, the computer is forced to shut down. At this point, with the safe sleep function introduced in the PowerBook G4 (15-inch Double-Layer SD) computers, the computer's memory contents have been saved to the hard drive. When power is restored, the computer returns itself to its pre-sleep state using the safe sleep image on the hard drive.
---

What is this file, and can I get rid of it?

If you can disable "safe sleep", then that should remove the file. Removing the file yourself sounds risky.

Chris

Message #4 - Posted 2009/02/15 - nospam

Previously, Chris Ridd wrote:

If you can disable "safe sleep", then that should remove the file. Removing the file yourself sounds risky.

disabling safe sleep does not remove the file, and with it disabled, the file is even modified every so often for some reason.

Message #5 - Posted 2009/02/15 - Chris Ridd

On 2009-02-15 14:37:38 +0000, nospam said:

Previously, Chris Ridd wrote:

If you can disable "safe sleep", then that should remove the file. Removing the file yourself sounds risky.

disabling safe sleep does not remove the file, and with it disabled, the file is even modified every so often for some reason.

Interesting. Can you catch the culprit using dtrace?

Chris

Message #6 - Posted 2009/02/15 - nospam

Previously, Chris Ridd wrote:

disabling safe sleep does not remove the file, and with it disabled, the file is even modified every so often for some reason.

Interesting. Can you catch the culprit using dtrace?

it happens too infrequently. the mod date right now is january 9th, and safe sleep has been off since october, when i got the machine.

Message #7 - Posted 2009/02/15 - Chris Ridd

On 2009-02-15 15:31:34 +0000, nospam said:

Previously, Chris Ridd wrote:

disabling safe sleep does not remove the file, and with it disabled, the file is even modified every so often for some reason.

Interesting. Can you catch the culprit using dtrace?

it happens too infrequently. the mod date right now is january 9th, and safe sleep has been off since october, when i got the machine.

I wonder what happened on Jan 9th. But you can have dtrace running in a terminal window with negligible impact on performance.

sudo dtrace -n 'syscall::open*:entry { self->path=copyinstr(arg0); } syscall::open*:return/self->path == "/private/vm/vm/SleepImage"/ { printf("%s opened SleepImage\n", execname) }'

Chris

Message #8 - Posted 2009/02/21 - MrAbbott

On Feb 14, 4:08 am, Pluto wrote:

I am short of space on my HD and find I have a huge 2GB file called "SleepImage" in the private/var/vm/ folder.

What is this file, and can I get rid of it?

Anyone?

If you don't want to mess with Terminal, probably the safest way to get rid of this file is to download "SuspendNow!" from MacUpdate (http://www.macupdate.com/info.php/id/30446/suspendnow%21). Use the "Delete Sleep Image" app in the Extras folder.

I use the DeepSleep widget to choose which sleep mode my machine uses: default mode only when I expect to need to change batteries or want to be totally sure of not losing any data; fast sleep mode almost all of the time. After I'm done using Safe Sleep mode, I delete the SleepImage file. In addition to taking up 4 GB on my disk, it's also an unsecured dump of the contents of RAM...and I don't like stuff like that sitting on my machine.

Message #9 - Posted 2009/02/22 - Calum

MrAbbott wrote:

I delete the
SleepImage file. In addition to taking up 4 GB on my disk, it's also an unsecured dump of the contents of RAM...and I don't like stuff like that sitting on my machine.

There is an encrypted hibernation mode too, but there seem to be some caveats. See <http://matt.ucc.asn.au/apple/machibernate.html>

Need Help? Have a Question?

Looking for more help, comments, and answers?

Ask your questions on Ask Different. Ask Different is a community of Apple users ready to help.