Hibernation and file/memory mgmt

User avatar
diegol
StarLounger
Posts: 94
Joined: 28 Jan 2010, 04:15
Location: Buenos Aires, Argentina

Hibernation and file/memory mgmt

Post by diegol »

When my laptop battery became useless two months ago I found sleep and hibernation were two different things (besides sleep being faster in er, sleeping and resuming than hibernation). After some research on the internet now I get the difference between the two, but there is something I still don't fully understand about hibernation. This is a swampy area for me, so apologies if this is too obvious or completely ridiculous.

Statement 1: hiberfil.sys is fixed at about the size of RAM.

Statement 2: Virtual memory comprises physical memory (RAM) and temporary data stored in the paging file.

Statement 3: The paging file is, by default, about 1.5 times as big as the size of RAM.

So for example, suppose you have 2GB RAM, which means a 2GB hiberfil.sys and a 3GB pagefile.sys. Total virtual memory: 5GB.
If you put your PC to some strain so all virtual memory is used and then decide to hibernate, where does hibernation write the 5GB to?

My presumption:
- RAM is written to hiberfil.sys (2GB)
- The remaining 3GB, which were stored in pagefile.sys, stay there, and Windows makes sure that when powering down this data is not overwritten, so as to be able to use it when the session is resumed.

Do you think this is correct?

Thanks a lot.

:argentina: Diegol

JoeP
SilverLounger
Posts: 2069
Joined: 25 Jan 2010, 02:12

Re: Hibernation and file/memory mgmt

Post by JoeP »

Statement #1 & #3 depend on the version of Windows.

Your premise about memory being written to hiberfil.sys is correct. Whatever part of the page file that is in use is not germane to hibernation process itself. It is just left alone. When a system is resumed from hibernation the contents of RAM are restored to hiberfil.sys and processing is resumed. So, any references to the undisturbed page file are still valid.

Joe
Joe

User avatar
StuartR
Administrator
Posts: 12604
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Hibernation and file/memory mgmt

Post by StuartR »

You only need to copy Physical memory (and hardware state) to the hibernation file.
StuartR


User avatar
diegol
StarLounger
Posts: 94
Joined: 28 Jan 2010, 04:15
Location: Buenos Aires, Argentina

Re: Hibernation and file/memory mgmt

Post by diegol »

Joe, Stuart,

Thank you very much for your prompt responses.

Kind regards,

:argentina: Diegol