[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Suspend a process in Linux

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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

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…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month14 days, 10 hours left to enroll

649 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