What is SleepImage

What is this file, and can I get rid of it?
Pluto wrote on :

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?

Tim Lance replied on :

On Sat, 14 Feb 2009 06:08:44 -0600, Pluto wrote (in article 140220091308442093%woodsjf@redacted.invalid):

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.

Chris Ridd replied on :

On 2009-02-14 12:08:44 +0000, Pluto woodsjf@redacted.invalid 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.

nospam replied on :

In article 6vq8f2Flf0r5U1@redacted.invalid, Chris Ridd chrisridd@redacted.invalid 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.

Chris Ridd replied on :

On 2009-02-15 14:37:38 +0000, nospam nospam@redacted.invalid said:

In article 6vq8f2Flf0r5U1@redacted.invalid, Chris Ridd chrisridd@redacted.invalid 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?

nospam replied on :

In article 6vqpc4Fl5hp6U1@redacted.invalid, Chris Ridd chrisridd@redacted.invalid 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.

Chris Ridd replied on :

On 2009-02-15 15:31:34 +0000, nospam nospam@redacted.invalid said:

In article 6vqpc4Fl5hp6U1@redacted.invalid, Chris Ridd chrisridd@redacted.invalid 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) }'

MrAbbott replied on :

On Feb 14, 4:08 am, Pluto wood...@redacted.invalid 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.

Calum replied on :

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