Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Yes, I know that hibernate usually applies to a computer. (Hibernate her meaning saving program memory in disk and being able to restore it in a consistent manner.)

However, hibernating a program can be very useful. Suppose I want to play a game, but a few programs like firefox, acrobat take up 500M of memory, so I want to free it up. Closing and then starting can be time-consuming, especially if session data cannot be stored. So instead I go and hibernate them. So is there any way I can hibernate a program?

share|improve this question
What OS are you using? – Ian C. Apr 25 '11 at 5:31
Windows 7, 64-bit. I also retagged the question. – apoorv020 Apr 25 '11 at 5:32
nice improvement for a OS... – kokbira Apr 25 '11 at 16:10
Related( but no answers)… – Sathya Apr 25 '11 at 18:17
up vote 7 down vote accepted

There's a related question about this over at StackOverflow. It's more programming related, but the main accepted answer explains why what you're trying to do is hard, and offers a viable alternative.

Basically, run your 'business' apps in a VM, and pause/hibernate/close it when you want to game.

share|improve this answer

While this is not an actual hibernate, the process can be suspended. It will immediately stop using CPU cycles, but is still will be using memory. Fortunately, this memory will be swapped to pagefile, if you launch any memory-intensive application afterwards, so it's not a real issue. Suspended process can't survive reboot\logoff, but this will be enough to play a game.

Related question: Suspend/Resume a process the easy way?

Internally, process suspending could be done via different approaches:

  • SuspendThread and ResumeThread function pair.

  • NtSuspendProcess function (not officially documented) that has been introduced with Windows XP Sp0 and works on every single system version since then.

  • Debugging Interface provided by Microsoft, using DebugActiveProcess and DebugActiveProcessStop functions. When a debugger attaches itself to a remote process, all the target’s threads immediately get suspended till the debugger gives a sign to let them execute.

There is a number of tools available, that can suspend a processes:

Moreover, Resource Monitor(Task ManagerPerformanceOpen Resource Monitor) in windows Vista and higher can suspend\resume processes:

Resource Monitor

share|improve this answer

"Hibernating" an app wouldn't be any faster than just closing and restarting it, although your point about session data is valid. In general there wouldn't be much if any advantage.

share|improve this answer
By what logic do you say that hibernating wouldn't be faster? Hibernating and restoring an OS is faster than a reboot. – apoorv020 Apr 26 '11 at 13:34
Think about what hibernating is. It requires copying the program image to hard disk, then copying it back. Closing the program and then restarting it only requires copying it from the hard disk. Windows starts up very slowly, for reasons I don't know. For other OS's, e.g. Linux, hibernating and awakening takes longer than just shutdown and reboot, at least on every system of mine I've tried it on. It's convenient but not fast. – CarlF Apr 26 '11 at 13:48
Well starting some programs is pretty slowtakes alot of time, especially firefox. Not to mention irritating as well. – apoorv020 Apr 26 '11 at 16:34
Closing the program and then restarting it only requires copying it from the hard disk. You are forgetting to add in the time it takes to get the program back into the state it was in. For example, re-opening a bunch of browser tabs, opening a file in an editor, etc. – Synetech Dec 17 '12 at 6:28

Since you're on Windows, you could always create two user accounts and use the fast account switching function in windows and use each of them for different sets of apps. Since Windows pretty much hibernates the other seesions opened on the computer. I think so.

share|improve this answer
Switching between user accounts in Windows 7 does not hibernate or in any other way suspend activity in the non-active account. You can prove this to yourself by playing some audio in one account then switching to the other account and observing that the audio continues to play. – Twisty Mar 4 '15 at 2:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .