OSU ENGR H192 - UNIX Process Monitoring and Control

Unformatted text preview:

UNIX Process Management and ControlProcesses in Modern-Day Operating Systemtop – Table of ProcessesViewing Only Your ProcessesYour ProcessesTerminating a ProcessKilling a Process from Within topKilling a Process from within topSlide 9Slide 10Killing a Process from the Command LineLect 16A P. 1 Engineering H192 - Computer Programming Winter QuarterThe Ohio State UniversityGateway Engineering Education CoalitionUNIX Process Management and ControlLecture 16ALect 16A P. 2 Engineering H192 - Computer Programming Winter QuarterThe Ohio State UniversityGateway Engineering Education CoalitionProcesses in Modern-Day Operating System•Multiple programs are loaded into memory and run to present the user with the operating system•Other programs are run by the user to complete tasks (applications)•Processes can be controlled manually by the user that owns them•Processes can sometimes behave badly–Use more CPU/Memory than it should–In a shared system this takes away CPU/Memory from other users–A user can monitor and stop misbehaving processesLect 16A P. 3 Engineering H192 - Computer Programming Winter QuarterThe Ohio State UniversityGateway Engineering Education Coalitiontop – Table of Processes•Allows anyone to see a list of processes running along with:–Process ID (PID)–Owner username–Memory Used–CPU Time–Current CPU Usage •Command: “top”•Initial Screen–All processes from all usersLect 16A P. 4 Engineering H192 - Computer Programming Winter QuarterThe Ohio State UniversityGateway Engineering Education CoalitionViewing Only Your Processes•top understands single-key commands–For a full list press “h”–To choose your user name press “u”•Enter YOUR username and press EnterLect 16A P. 5 Engineering H192 - Computer Programming Winter QuarterThe Ohio State UniversityGateway Engineering Education CoalitionYour Processes•System Processes–KDE* (X Windows)–SSH (Secure Shell)•Applications–MATLAB–bash (command prompt)–top (this program)–g??.out (your compiled programs)Lect 16A P. 6 Engineering H192 - Computer Programming Winter QuarterThe Ohio State UniversityGateway Engineering Education CoalitionTerminating a Process•Occasionally a user loses access to a running process, but it is still running. –This wastes CPU and memory resources.–Users should terminate these “runaway” processes.•Processes can be killed (terminated) directly within top and from a terminal window.•Only kill processes you know should no longer be running. Randomly terminating system processes can make your environment unstable!•You can only terminate your own processes.Lect 16A P. 7 Engineering H192 - Computer Programming Winter QuarterThe Ohio State UniversityGateway Engineering Education CoalitionKilling a Process from Within top•MATLAB application window closed, but is still running on the system–Program has used nearly 12 minutes of CPU time–Kill a process by pressing “k”Lect 16A P. 8 Engineering H192 - Computer Programming Winter QuarterThe Ohio State UniversityGateway Engineering Education CoalitionKilling a Process from within top•Enter the Process ID (PID) and press EnterLect 16A P. 9 Engineering H192 - Computer Programming Winter QuarterThe Ohio State UniversityGateway Engineering Education CoalitionKilling a Process from within top•Processes can be killed with multiple “signals”–Tells the process how to terminate–Most common: •15 – Terminate as if program closed normally•9 – Terminate immediately (forced quit)–For a list: “kill -l” at a terminal prompt (The letter l not the number 1, and not within top)•In top: press Enter for 15 [default] or enter another signal number and press EnterLect 16A P. 10 Engineering H192 - Computer Programming Winter QuarterThe Ohio State UniversityGateway Engineering Education CoalitionKilling a Process from within top•The process should disappear from the list–If it does not disappear with signal 15, try signal 9–If signal 9 doesn’t work (in rare cases), an administrator will have to terminate the process for you•To exit top: press “q”Lect 16A P. 11 Engineering H192 - Computer Programming Winter QuarterThe Ohio State UniversityGateway Engineering Education CoalitionKilling a Process from the Command Line•List processes: “ps –u <name.#>”•Kill a process: “kill –s <signal> <PID>”•Kill all by name: “killall <process


View Full Document

OSU ENGR H192 - UNIX Process Monitoring and Control

Documents in this Course
Strings

Strings

22 pages

Load more
Download UNIX Process Monitoring and Control
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view UNIX Process Monitoring and Control and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view UNIX Process Monitoring and Control 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?