Is there a way to hibernate windows applications separately?

13

2

Just freeze an application (suspend the CPU, save its state to disk) and 'defrost' it when I want to use it 4 weeks later.

William C

Posted 2010-11-26T15:56:24.413

Reputation: 131

1

This is one feature new OSes should support.

– Pacerier – 2014-11-19T11:59:19.583

Answers

8

Many people would wish for this, including myself.
Alas, no. This operation does not exist, and cannot exist.

Think for example about freezing an application that had an open file on the CD or an open Internet connection. Now imagine what it would take to "freeze" and "unfreeze" it: All files and connections to be saved, then re-created, CD drive maybe to be verified and file opened, Internet connections to be re-established with all login info into the site, etc etc.

This is just too complex to implement in any operating system, and would also be a security hole.

harrymc

Posted 2010-11-26T15:56:24.413

Reputation: 306 093

@harrymc, It wouldn't have to be complex if the OS was designed from ground up to have this feature in the first place. It's the monkey patching that's hard, not the feature itself. – Pacerier – 2014-11-19T11:58:14.580

2Virtual machines? That's awfully clunky though. – Shinrai – 2010-11-26T16:11:49.133

set the priority of the app to the lowest setting? this of course would not free up the used RAM – Xantec – 2010-11-26T16:32:51.183

1@Xantec: This wouldn't withstand a reboot. – harrymc – 2010-11-26T17:12:29.590

@Shinrai: Good suggestion for the case where there are no CD or Internet. – harrymc – 2010-11-26T17:14:47.043

@harrymc: No, it is possible, though it's not commonplace. I've heard of Unix variants with restartable core dumps (I don't know how they work wrt file descriptors). And traditional Lisp implementations can dump memory (here it's up to the standard library to do something about open files). I suspect better facilities exist on some mainframe OSes or OSes on some embedded devices (communication equipment?). – Gilles 'SO- stop being evil' – 2010-11-27T00:43:15.283

@Gilles: Unfortunately not on Windows, and I have searched. One can force a fulldump on a running application, but .dmp files are not restartable, just usable for analyzing a crash. – harrymc – 2010-11-27T08:28:56.413

There's a program for Linux that can "hibernate" individual processes (and even resume them on different machines) - I hope it's possible to port it to Windows. http://cryopid.berlios.de/

– Anderson Green – 2012-12-03T19:27:34.627

@AndersonGreen: Alas, CryoPID also does only partial suspend/resume. – harrymc – 2012-12-03T19:41:33.100

@harrymc Why is it considered "partial"? – Anderson Green – 2012-12-03T19:43:38.610

@AndersonGreen: No support for threads, TCP will only work if the server website remembers the program, no support for removable media, X applications not supported (special compile required), and see also the brown-colored items in the list. – harrymc – 2012-12-03T19:48:43.653

1then how the heck does windows even hibernate? you state it's impossible. If you can fully hibernate then partial hibernation should be just as easy – Gizmo – 2014-06-16T18:16:19.260

@Gizmo: The hibernation of Windows is also not guaranteed to work, in exactly the same cases for programs using the CD or the Internet when frozen. – harrymc – 2014-06-16T18:34:40.607

1so, I if windows hibernation is able to suspend my game, I can probably suspend it as long as it doesn't use the internet, CD drive, or anything that will be unavailanle afterwards? Then how do I accomplish per-process suspension and restoration? – Gizmo – 2014-06-16T19:15:37.863

@Gizmo: You don't - nobody ever created this very complicated software which has to work from inside the operating system. Neither Microsoft nor Linux thought it justifies the effort. For gaming, create a virtual machine and install your game in it. The VM can be suspended and restarted. – harrymc – 2014-06-16T19:38:43.683

2

While some systems do have such a technology, it takes a lot of effort on both the operating system developer's and the application developer's parts. So, in practice, consider the answer to be no. (Examples of systems where this can work are Unix variants where core dumps are restartable and Lisp implementations that have a dump facility. Even then this may behave strangely if the application has connections to the outside world such as open files.)

You can run the application in a virtual machine (e.g. Virtual PC), and hibernate (save the state of) the whole VM. You will need a suitable Windows license in the VM. If you start using VMs, expect your RAM usage to go way up (if you're running a host OS and a virtualized OS, the memory requirements add up).

Gilles 'SO- stop being evil'

Posted 2010-11-26T15:56:24.413

Reputation: 58 319

1

Technically, yes.

You can suspend it:

Windows: Resource Monitor>Memory>Right-Click "process.exe">Suspend

Linux: "kill -[STOP/CONT] [PID]"

But it will remain in RAM, even if it isn't using CPU power.

Therefore, you would have to either keep your computer on or set it strictly to hibernate in order to keep the process from dying. In the meantime, if your computer is configured properly (I haven't read that deep into it), it should be able to move the suspended process into your page file when it needs more physical RAM.

I know this response is late, but I came across this question while looking for the exact same thing, so I figure I can help any future adventurers find what they're looking for. Who knows? Maybe in the future they may develop the potentially AI-powered software to accomplish this.

Mr. Fraggle

Posted 2010-11-26T15:56:24.413

Reputation: 31

1Author isn’t using Linux. This was posted as an answer, but it does not attempt to answer the question. It should possibly be an edit, a comment, another question, or deleted altogether. – Ramhound – 2018-10-18T05:09:28.780

@Ramhound This answer provides methods for both Windows and Linux. I cannot verify whether the suggested approach for Windows works, but it certainly is in the answer. The method mentioned for Linux works (I have frequently used it myself). – kasperd – 2018-10-18T13:28:56.663