Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Similar to this: How to "hibernate a process" under Linux/Windows?

Are there any methods to hibernate a process in a way that it doesn't stay in memory? E.g.: If I don't want to use Firefox, and don't want to close the process of it, and I need free memory, then how can I really hibernate the process so the memory reserved by Firefox is freed up?

I need solution for both Windows and Linux!

share|improve this question

6 Answers 6

up vote 3 down vote accepted
+100

If I don't want to use Firefox, and don't want to close the process of it, and I need free memory, then how can I really hibernate the process so the memory reserved by Firefox is freed up?

For Windows, there is Free Process Freezer.

For Linux and Mac OS X, there is CrypoPID, as mentioned in yeedl's answer.


If you want to come up with a custom solution:

Look into process dumping on Windows, eg. ProcDump, resume it with a CLI debugger from WinDBG.

Look into core dumping on Linux, eg. core, resume it with a CLI debugger like GNU GDB.

I bet a software based solution that doesn't involve a debugger is possible, but that's for Stack Overflow.


You're looking for a very specific use case, why don't just suspend and let it swap out?

You would be spending more time on getting your processes running and suspending...

I believe you can optimize your workflow in another way that would be more seamless.

share|improve this answer

Both Windows and Linux/Unix provide a way to suspend or stop a process from executing, by removing it from the list of runnable processes.

This doesn't directly affect the memory pages owned by a process, but over time as the system comes under pressure for memory those pages will be good candidates to swap out to disk.

Trying to write out a process to disk for later resumption isn't going to work for anything non-trivial. Open handles to the network and windowing system will fail as soon as the process resumes.

share|improve this answer
    
It wouldn't work for anything trivial either. :) +1 –  Mehrdad Jun 9 '11 at 14:51
1  
Those open handles are just opened again or stored along, so that isn't really a problem... –  Tom Wijsman Jun 14 '11 at 11:21

I know in firefox you can save a session.

In Linux, this can be done with CrypoPID.

This question and this one try to answer it for Windows, but I couldn't find a great solution of saving an application state to a file like I did for linux.

share|improve this answer

For Windows:

I don't know any way to completely evict a process from memory without killing it, but you can trim its working set by minimizing its main window. Microsoft has an article explaining this: The working set of an application is trimmed when its top-level window is minimized.

So, first minimize the main window(s), then suspend the process as suggested in the question you linked.

You can accomplish both with the ever-useful Process Explorer.

  • Right click process, Window -> Minimize
  • Right click again, Suspend.
share|improve this answer

On Windows, some programs can swap-out "unused" program memory.
An example of a product that can do that is the commercial Process Lasso.
However, even Process Lasso counsels against that practice.

From The Truth about Windows Memory Optimizers :

It is best to leave the management of virtual memory to Windows and not take it into your own hands. Any benefit from these programs is an illusion and temporary. You incur the penalties of paging memory back in sooner or later, even if it appears that the program you run after the cleanup loads faster.

Now as regarding Firefox, see mozillaZine's Reducing memory usage - Firefox, which contains lots of advice on how to discover which extensions leak memory.

There is also the Firefox extension Memory Fox which :

Attempting to reduce the browser's RAM Memory usage promoting the increase of available RAM memories for other application processes RAM memory requirements. Hopefully, fostering any attempts of Memory Recovery and Retention.

In my experience this extension only postpones the inevitable memory-bloat of Firefox. The only real solution is to close Firefox from time to time to liberate memory.

share|improve this answer

You can send STOP signal to processes in Linux. A stopped process is like paused. To resume it send the process CONT signal. To send the signal you can do this:

kill -STOP process_id

kill -CONT process_id

A stopped process will be swapped out if system requires more memory.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.