Showing posts with label apple. Show all posts
Showing posts with label apple. Show all posts

Sunday, December 5, 2010

SmartSleep and Secure Virtual Memory

I used SmartSleep for a long time to control my MacBook Pro's sleeping habits. I've finally discovered that this utility doesn't work with Secure Virtual Memory. First, some background.

There are essentially 2 ways a Mac can sleep. The first is 'regular sleep', or for you Windows users, suspend. In this mode the computer saves power by shutting down peripheral hardware (like the disks, screen and keyboard light) while keeping the processor in a low power state. The battery is used to keep the RAM powered so that when you resume (ie. open the lid) the computer can turn everything back on and start right back where it left off.

The second is called 'safe sleep'. This is like hibernate mode for Windows users. In this mode the computer RAM and processor state is written out to disk and the computer is turned off. Obviously this is very power efficient (off == good for battery life!). The problem with this mode is that when you want to use the computer you have to wait a LONG time for the resume process to complete. On my machine I have 8 GB of RAM (on a laptop - how far we've come!). It takes almost 2 minutes to resume my machine in safe sleep.

SmartSleep is supposed to let you control and choose these modes. There is also a hybrid mode that will suspend AND hibernate, but only power down the machine if the battery goes too low. If the battery is removed or dies, you can then resume like you did from a hibernate. It takes a long time but it works and you loose no data. In the best case it resumes quickly because the state of the processor/RAM was preserved by the battery power.

Now enters Secure Virtual Memory. I use this setting because I don't want data like key material and passwords leaking into my swap file. It has almost no impact on performance and in the case that my laptop is stolen or captured at the border it will protect my privacy rights. You can turn on Secure Virtual Memory in the Security System Preferences Pane.

SmartSleep doesn't take the Secure Virtual Memory setting into account. This means that if you have it turned on it sets the hibernatemode option incorrectly. When my machine goes into safe-sleep, it can't recover and I'm forced to reboot (and loose data!). Here is the settings that should be used:

The hibernatemode option in power management settings selects the suspend policy:
$ sudo pmset -a hibernatemode 0
always regular sleep (disable safe-sleep)
$ sudo pmset -a hibernatemode 1
always safe-sleep (disable regular sleep)
$ sudo pmset -a hibernatemode 3
regular sleep first, safe-sleep if the battery is very low on power or is unplugged
$ sudo pmset -a hibernatemode 5
always safe-sleep with secure virtual memory
$ sudo pmset -a hibernatemode 7
regular sleep first then safe-sleep with secure virtual memory
To find out what setting you are currently just type:
pmset -g | grep hibernatemode

I've uninstalled SmartSleep for now and will send this feedback to the author to see if it can be fixed.

Sunday, July 18, 2010

iPhone4 Hatred

There is a lot of iPhone 4 hatred out there. Apple has recently come under a lot of fire for antenna performance, lack of so called 4G (actually 3.9G LTE). Let's examine the first criticism objectively in this post and I'll address the others in upcoming posts. First a comedic interlude. 



So what is really going on with these antenna issues? Consumer Reports rated the new iPhone 4 as the top smart phone it has ever tested, only to not recommend it due to the antenna issues. I keep saying issues because it can be broken down into two parts. First, the way iOS4 reported signal strength gave people a false sense that signal was stronger then it really was. Anandtec has a great illustration of the difference between what iOS reported in 4.0 to 4.0.1. 
As you can see the middle range was very compressed. The new way will tell people just how crappy we all know the 3G GSM network is that AT&T provides. For those of you Android fans, I suggest you check the link out and see what Droid reports. iOS4 now reports the least compressed bar range out of any smartphone.

The second issue is hand placement. This generated a lot of play in the press and is a real problem for some users. If you place your hand on a certain spot, you can drop your phone performance considerably. Anandtec discusses it in the above article and Apple has posted about their testing. Compared to other phones, Apple made a different design decision -- they opted for good performance in low signal situations. Considering the fact that they are on AT&T's network this is probably a wise choice. A case and better hand placement can reduce the impact of that giant attenuator known as the human body. I usually use my bluetooth anyway (I'm one of those that only seem to call while driving or walking through the city) so I've not been as impacted as others.

Other phone manufactures have responded with weasel words, but have not challenged any of the findings published on Apples website. Apple has offered free cases to iPhone purchasers, Details on how to order a free Bumper or case will be available soon on apple.com.