Solved

Suspend a process in Linux

Posted on 2006-07-23
4
3,964 Views
Last Modified: 2012-05-05
Hi expert

How do swapout a suspended process   in Linux ? i.e

It should be moved from Main memory to swap without killing the process
and later on when resumed it must be swapped in back to main memory

0
Comment
Question by:mmadhuso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 37

Expert Comment

by:Harisha M G
ID: 17164035
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 17164322
bg & fg as mentioned by mgh_mgharish suspend run a suspended process in background or foreground / interactively. You suspend the current interactive program with SIGSTOP (control-Z usually).
From your question I imagine you knew all that already.
Whether a process is swapped out or in is really not a regular user's concern. Linux manages memory as it will. Really, "Swap" is an old-fashioned term - Linux is a demand - paging system where the least recently used pages of memory are freed up as required. Those that have been written to (jargon is "are dirty") are written to "swap"; those that are (jargon) "clean" are simply discarded. "Clean" includes program and library code, which are paged back in from the executable when again needed. If you google for "demand paging" you may find some links - I have to go now.
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17165767
I can only confirm what duncan_roe pointed out. There is no way under linux to force taks to moved to swap. Interesting, but You can prevent taks(some of its memory pages) from beeing moved to swap...
Also, just for a recors: after You SIGSTOP the application, You have to SIGCONT to wake it up again.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
ID: 17165960
> How do swapout a suspended process   in Linux ?
you don't need to do that, the kernel does it automatically for you, hence there is no API for it.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question