Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

iMac Sleep Image necessary?

Hi have an iMac with 12GB of ram and have a sleep image of the same size.

I thought only MacBooks save the content of the ram to the hard drive in case the battery runs out.

Why does the iMac do the same? It's always connected to a power source.

iMac, Mac OS X (10.6.6)

Posted on Feb 28, 2011 10:20 AM

Reply
15 replies

Feb 28, 2011 10:54 PM in response to tz12

It should be in /var/vm.

If it isn't, or if the date modified isn't recent, just delete it. The system will recreate it if needed.

How did you set your Mac up? It almost sounds like you cloned it from a laptop, but I didn't think you could get a laptop with that much RAM.

Or do you have a 3rd-party app that might be doing that?

Mar 1, 2011 5:41 AM in response to Pondini

My 21.5" i3 iMac with 10.6.6 does the same thing. It was not cloned from a laptop but I did use the Migration Assistant to bring user stuff over from a MacBook. The sleepimage file, however, is dated about a month later than that event but has not been modified in about a week.

I deleted it and put the computer to sleep and it was not re-created.

Very odd.

-dan

Mar 1, 2011 3:35 PM in response to tz12

tz12 wrote:
I too transferred my files over from a MacBook.

Will try and delete the sleepimage.

But isn't there a way of check via the Terminal App what kind of sleep mode the mac is using?

Maybe I have to change it there as the MacBook settings may have been ported over.


Desktop Macs have Display Sleep, but only one Computer Sleep mode. RAM is not powered-off, thus no sleepimage file is needed.

Mar 1, 2011 5:10 PM in response to tz12

The sleep file has not re-appeared.

Also of interest (maybe) is that in var/rm there were two swapfiles, 0 and 1. That suggests to me that both the sleep file and the swap files were copied from the MacBook and when the iMac went to make its own swap, it had to append the 1 to create the file. I deleted both swap files and only swap0 has been re-created.

-dan

Mar 1, 2011 9:01 PM in response to DanH

DanH wrote:
The sleep file has not re-appeared.


Cool. 🙂

Also of interest (maybe) is that in var/rm there were two swapfiles, 0 and 1. That suggests to me that both the sleep file and the swap files were copied from the MacBook and when the iMac went to make its own swap, it had to append the 1 to create the file. I deleted both swap files and only swap0 has been re-created.


No, those were made by your Mac. When it starts up, all old ones are deleted, then swapfile(0) is created, at 67 mb. If/when more are needed, OSX will make them. After 2 or 3 (I forget just how many), they'll start doubling in size. If you're running lots of memory-intensive apps, and/or have an app with a memory "leak" (not releasing memory when it's not needed), you can end up with a LOT of them.

Mar 2, 2011 10:43 AM in response to tz12

I think this should do it. (I'd have a backup just in case.) This is what the default should be on a Desktop.

*sudo pmset -a hibernatemode 0*

Then trash the sleepimage file.

Then log out and in or restart. You will need to enter your password which you won't see echoed on the screen.

You can first check to see what the default is on your Mac using.

*pmset -g | grep hibernatemode*



From man pmset.

SAFE SLEEP ARGUMENTS
hibernatemode takes a bitfield argument defining SafeSleep behavior.
Passing 0 disables SafeSleep altogether, forcing the computer into a reg-
ular sleep.


hibernatemode = 0 (binary 0000) by default on supported desktops. The
system will not back memory up to persistent storage. The system must
wake from the contents of memory; the system will lose context on power
This is, historically, plain old sleep.





There's also a GUI that may do this called SmartSleep available now only at the App Store (yuck- and I wouldn't want to pay for a GUI wrapper around a simple command like this.)

http://www.jinx.de/SmartSleep.html

Message was edited by: WZZZ

iMac Sleep Image necessary?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.