[Galaxy S II General] cmd512:
First and foremost, this will only apply to you if you have seen the following symptom:

You go to Settings -> About phone -> Battery usage -> click on the graph above and see "Awake" as a solid bar instead of (mostly) lining up with the "Screen on" spotted bar below. Here's my previous thread of when I discovered this issue when my "Awake" bar showed solid for an entire 8 hours when my "Screen on" would show frequent off/on's:

http://xdaforums.com/showpost.php?p=13938317&postcount=772

I found my SGSII was getting decent battery life, but idle was certainly worse than my SGSI. I couldn't figure it out for the life of me what could be causing it given I was running the exact same apps as my SGSI 2.2.1 handset, but the solid Awake bar did not sit well with me.

Observations:

1) After 8+ hours of solid Awake, I would have no apps running under Settings -> Applications -> Running services except for those that I normally would expect in the background... Settings, NoLED, Google Voice, Swype, etc.

2) I noticed that under this "Running services" screen, if you hit Menu and select "Show cached processes," there are actually other cached processes that are in a semi-dormant state. Are they running or are they not? Hmmm....

3) After a system restart, the Awake and Screen on would line up once again.

Suspicion/Hypothesis:

Some app that I normally have running... even if I completely exit out of, it would sit under cached processes and somehow still keep the device awake.

Testing:

First, wanted to see which app when normally running would keep the phone "Awake." After a few days of testing, isolated it down to eBuddy, which is a chat client I used to have running nonstop on my Froyo SGS. So, after several hours of running eBuddy and seeing a solid Awake bar, I exited out of eBuddy properly (Menu -> Exit), ensured it was no longer running under Running services, and tested it for another 4 hours. Sure enough, with the device mostly idle and eBuddy shutdown,

the Awake remained solid/on!

So, I then revisited Settings -> Applications -> Running services -> Menu -> Show cached processes, I saw eBuddy was still cached and taking up memory. So, I clicked on the process and chose Force stop. Afterwards, I let the device idle for a few hours more, and the Awake and Screen on lined up once again.

Conclusion:

I'm not sure if this is a Gingerbread bug or eBuddy bug or a combination thereof, but something changed in the code from Froyo to Gingerbread. Probably has to do with this caching feature, but there ARE apps out there that will keep your device constantly on

even if

you do properly exit out of them.

Solution:

I used to run "Advanced Task Killer" on my SGS with Froyo but never bothered with Gingerbread because people much smarter than me on here have said time and time again "it's not necessary for Gingerbread, you're wasting time/battery life." Well, that still may be true, but given there are these rogue apps that will cause Gingerbread to stay constantly awake, Advanced Task Killer is the best solution at this time.

(It may not be pretty, but hey, it works.)

So, I installed Advanced Task Killer, did a fresh boot, put all the system apps and other apps I don't want ever shut down (Email, Swype, Settings, etc) on the ignore list, turned the kill setting to every hour, and let it sit. I can say for the past 2 days, my idle battery life has improved significantly. Normally by the end of my work day, I'd be skimming along around 40-50%. (Keep in mind, I use the phone primarily for business, which means 2 push E-mails, 2 pull E-mails, constant text messaging, and lots of phone calls.) The last two days, I have been easily at 70-80% by the end of the day. For instance, right now at 4PM CST, I am still at 82% remaining battery.

Also, keep in mind, I have just about EVERYTHING else I don't need frozen/uninstalled through Titanium backup. This includes but not limited to WIFI Sharing, all the hubs, all the readers, all the SNS junk, AP News, Accuweather, etc.

And the most telling bit that the fix is working: My Screen on and Awake line up perfectly with no more solid bar for Awake. And, this is even after running eBuddy last night.

I know this won't help everyone, but hopefully, it will be of use for some of you. Good luck!