?
Solved

Suspend a process in Linux

Posted on 2006-07-23
4
Medium Priority
?
3,974 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 35

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 200 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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

765 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