I often program outside away from power, how can I extend the battery life in my laptop to let me program longer without having to "return to base"
Specifically for a MacBook Pro.
I often program outside away from power, how can I extend the battery life in my laptop to let me program longer without having to "return to base"
Specifically for a MacBook Pro.
To extend the battery life per session, reduce brightness, turn off WiFi and Bluetooth if possible, and run as few programs (and as low CPU intensive programs) as possible.
To extend the overall life of the battery, keep it plugged in as much as possible. The fewer cycles, the better the battery's maximum capacity will be.
and this is?
http://stackoverflow.com/questions/34215/what-are-the-best-alternatives-to-notepad
My laptop is a tool I use for programming. I need the battery to last so I can continue to program when I don't have access to power, and as such tips on improving battery life would be helpful.
The edited version of this is probably OK (thank you for editing the question to make it programmer-centric, at least a little!)
I wrote two articles measuring power draw on laptops, you can infer a lot from the numbers:
http://www.codinghorror.com/blog/archives/000562.html
http://www.codinghorror.com/blog/archives/001099.html
Summary.. when you're on battery:
One advantage of the "battery saver" power modes is that they effectively throttle the CPU, which is still the largest power consumer in a laptop. So use those!
I've been coding on my macbook pro for over a year now, and by far the most significant factor is the screen brightness.
The next significant factor is the age of your battery.
Of course, running CPU-intense operations is also a drain.
Side tip : For those mac users like me who never log out - If you're using file vault, you actually aren't reclaiming disk space from your deleted files in file vault until the next time you log out while your laptop is plugged in . Good to know.
At least on my Precision M65, I have noticed intensive CPU utilization when it gets too hot (poor ventilation), and since CPU usage is directly proportional to batter life, that should be avoided. Make sure that you are working with your laptop so that it has plenty of ventilation and it doesn't get too hot.
Quit everything possible, including applications running in the menu bar. Turn the screen brightness down as far as possible. Turn Airport (wifi) and Bluetooth off. Don't use the DVD drive. Try do avoid doing CPU or graphics-card intensive stuff. Obvious, sleep the machine when you're not using it for short periods of time, and either "deep sleep" (see aliases at end of comment) or shut the machine down if you're not going to use it for an hour or more.
In ~/.profile add the following:
# Laptop sleep/hibernate thingy. on == "deep sleep", off == "quick sleep"
alias hibernateon='sudo pmset -a hibernatemode 1'
alias hibernateoff='sudo pmset -a hibernatemode 0'
Then run hibernateon
to go in to "deep sleep" (where the contents of RAM are written to the disc, and the machine uses practically no power), or hibernateoff
to return to the default sleep behaviour (where it starts up very quick, but uses a bit of power to keep data in RAM).
If you are under Un*x you can also use the powertop(1) program to analyze your laptop's power consumption. It is sufficiently smart to make suggestions of its own, such as disabling Bluetooth.
I have a MacBook Pro and use it all the time. I went through a lot of batteries on my old powerbook, so I decided to record monthly stats on my battery life and from that, developed usage/charging patterns which seems to maximise battery capacity retention over the battery's lifetime. I still comfortably get around 3- 3.5 hours on full charge, with full screen brightness and a VM running, even though my battery is nearly at 400 charge cycles.
Here's how:
First thing to realise is that the battery will rapidly lose capacity if it is kept at 100% charge, and in high temperatures. Optimal charge for retaining capacity is supposedly 40%, therefore:
Your battery will need recalibrating from time to time:
The next thing to note is that old batteries are good as UPSs. Hang on to them and use them like that. Buy a new battery (really new, not one that has been hanging around in a shop), charge it 50%, store it in a bag in the fridge. It will hold its capacity very well for a long time in this state. When you need it, take it out and let it warm up in a towel, to avoid condensation problems, before charging it.
Doing this you are using the old battery to extend the life of the new one.
Remember of course that macs are designed to be able to change battery while sleeping.
The new macs have a built in battery that supposedly can go 1000 cycles, and hold a lot more charge. Lets hope this technology will find its way into replaceable batteries in the future.
Regarding actual daily usage - I find on my machine with its low power LED backlight, the main battery eater is the CPU. So I monitor CPU using Activity Monitor. Its easy for processes to run away unnoticed when you have more than 1 CPU. Don't bother with let HDDs spin down. It takes more energy to spin them up again quickly than to simply leave them spinning for 30 mins or so.
FYI mine is an early 2008 MacBook pro 17 inch.
I'm pretty sure that running code from RAM (i.e., making a virtual RAM drive) saves battery too - just like using a solid state drive does. Only thing is, RAM is probably a lot faster.
The abutting affair to agenda is that old batteries are acceptable as UPSs. Hang on to them and use them like that. Buy a fresh array (really new, not one that has been blind about in a shop), allegation it 50%, abundance it in a bag in the fridge. It will authority its accommodation absolute able-bodied for a continued time in this state. Back you allegation it, booty it out and let it balmy up in a towel, to abstain abstract problems, afore charging it.
Doing this you are application the old array to extend the activity of the fresh one.
Remember of advance that macs are advised to be able to change array while sleeping.
The fresh macs accept a congenital in array that allegedly can go 1000 cycles, and authority a lot added charge. Lets achievement this technology will acquisition its way into dispensable batteries in the future. http://goo.gl/h1PF Regarding absolute circadian acceptance - I acquisition on my apparatus with its low ability LED backlight, the capital array eater is the CPU. So I adviser CPU application Activity Monitor. Its accessible for processes to run abroad disregarded back you accept added than 1 CPU. Don't bother with let HDDs circuit down. It takes added activity to circuit them up afresh bound than to artlessly leave them spinning for 30 mins or so.