Alex Kaloostian

Apple Certified Master Trainer | Systems Integrator | Video Editor | Motion Graphics Artist

Reclaiming drive space and speeding up sleep on mac portables

Leave a comment

Is your Mac taking too long to wake from sleep? Or do you have a MacBook Air with a small drive and you need all the storage space you can get? Leopard & Snow Leopard now save the contents of your RAM to disk before sleeping so if your computer loses power, you won’t lose the contents of memory. Here’s how to change it:

sudo pmset -a hibernatemode 0
sudo pmset -a hibernatemode 1
sudo pmset -a hibernatemode 3

“0” is traditional sleep: the contents of memory will not be saved to disk, and power will continue flowing to your RAM, to maintain what’s in it when you wake up. If your computer loses power or your battery dies, you will lose all unsaved changes and you will have to re-boot your Mac.

“1” is hibernate mode: Memory will be saved to disk and power will NOT continue flowing to your RAM. This will take even longer to sleep and wake but your computer will use even less power when asleep. Note that the sleep image file on your hard drive will be as large as your installed RAM: if you have 4 GB of RAM, thats 4GB saved to your disk. That’s a lot if you have only a 64GB SSD.

“3” is now the default for laptops: this will keep power flowing to your RAM, and save the contents of memory to disk in case your power goes out.

After changing this setting (at your own risk! Don’t blame me if you lose unsaved changes when your battery dies!) You should delete the sleep image to reclaim that hard drive space. Delete /var/vm/sleepimage as an administrator and you’re done.

There are even more tricks you can apply if you read the man page for the pmsetcommand, for example, this setting can be configured differently if you are on a power supply or battery, and automatically switch, or you can disable sleep if a remote process is logged in, like screen sharing or ssh. Cool.

Author: alexkaloostian

I'm a video editor, motion graphics designer and Mac IT consultant in the Boston area.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s