Another way to insure a good balance between battery life and available memory is to manage your "minimum free memory" options in "Settings -> Performance -> Memory Settings".
There are 4 presets:
- Very Light
- Very Aggressive
"Very Aggressive" tries to keep the most free memory. When it detects that the amount of free memory is less than what you specified then the "Low Memory Killer"(LMK) goes through the list of processes that are running and kills any of them that it can until the specified amount memory is free. You might think that is going to be the best option but not necessarily so; That option may cause LMK to be constantly working to free memory even when you are not doing anything. I suspect that when some apps are killed, they get automatically re-launched. So LMK is eating your battery by constantly killing apps.
You can observe this behaviour running the following commands in the terminal emulator or adb:You will see message like the following:
Every time you see those messages, it's LMK trying to free memory to satisfy the request of keeping "minimum free memory". It's OK to see it occasionally but if it's happening all the time, the "minimum free memory" setting is too high and you try lowering it.
I usually float between Aggressive and Normal.