Solved

Suspend a process in Linux

Posted on 2006-07-23
4
3,918 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
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
linux copy files from usb to folder on system 14 59
Best way to split and output to csv in bash 2 61
Message not shown 5 31
Linux Copy Command - All Files inc Directory 1 28
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now