Why was my system able to sleep without power?

I'm using an AMD Phenom II desktop running Windows 7 that I custom built. I put the system to sleep (not hibernate) then I accidentally shut off the power supply that it was connected to as well, so the system was not being supplied any power. My understanding of sleep is that it needs a little power since it does not save any information to disk. However, when I turned on the system several hours later, it still woke up from sleep and all the windows I had open were restored just as they were before.

How is this possible?!? :O


Solution 1:

It's hybrid sleep, a combination of hibernation and sleep. It saves memory to disk, and then enters sleep (the low power state). If power is maintained, when you turn the computer back on, it simply wakes from sleep. If power is lost, it can recover, as if the computer was hibernated.

Solution 2:

Because starting with Vista, sleep got a little smarter. It now also writes everything to disk, meaning you can cut the power just fine. It's pretty neat, and has saved me a good few times.