Use Process Manager to display the processes that are running on your workstation, and to perform actions on them. You can do this without knowing the syntax for ps(1), truss(1), kill(1), and other character-based commands. Where relevant, the equivalent UNIX commands are given for each Process Manager action.
UNIX works with processes. Your login shell, application programs, the edit session you run, and even the ls program that lists your files are all processes under control of the operating environment.
In UNIX you can perform operations on these processes. For example, you can look at all the programs you're running at any time, stop and restart programs as you choose, and investigate and debug errant processes.
An errant process is a process that is not doing the job you expect it to do. For example, a process might be consuming a large percentage of your available resources due to a bug, or it might be interfering with another process. Use Process Manager to detect errant processes when you experience the following:
Workstation performance or response seems to have slowed.
A program will not respond to user input.
A standard service such as printing, file transfer or remote login does not respond.
When displaying all processes, Process Manager typically displays thirty to fifty processes, so finding the errant processes can be daunting to the untrained eye. The following tips may help (otherwise contact your System Administrator):
Use Performance Meter to see if performance parameters such as CPU usage or disk usage are exceptionally high. If so, you can use Process Manager to identify the errant process.
Use Process Manager to identify:
Processes using a large percentage of the available CPU or RAM when they shouldn't
Orphaned processes whose parent process has reverted to 1, that is init (but not processes such as sched, dtlogin, or cron whose parent process ID should be 1)
Processes that were started a long time ago and weren't terminated when they should have been
Large processes owned by another user that are degrading performance
Process Manager displays and provides access to processes that are running on your workstation.
Each process entry in the list gives you useful information, as explained in the following table:
Column Heading | Meaning |
---|---|
ID | Process ID |
Name | Process Name |
Owner | Name of Owner |
CPU% | Ratio of CPU time used recently to time available in the same period, expressed as a percentage |
RAM | Amount of RAM currently occupied by this process |
Swap | Total size in virtual memory |
Started | Actual start time (or date if other than current) |
Parent | Process ID of parent process, or PPID |
Command | Actual UNIX command (truncated) being executed |
You can perform the following actions without affecting any processes on the selected workstation:
Display all processes, or only those containing a specified character string
Find processes containing a specified character string
Display processes sorted by any of the columns in the scrolling pane
Change the sampling interval, and copy and save the sample information
Click the Find Process control on the Tools subpanel of the Front Panel.
The Process Manager main window is displayed. It immediately samples the workstation and displays a sample of all current processes.
Type your filter text into the Filter field of the Process Manager window.
You filter text should be a string of characters that is common to the process entries of the subset or group of processes you want to display. For example, in Figure 19–1 the user is displaying all processes relating to Audio Tool.
Press Return.
Process Manager updates the processes in the scrolling pane to include only those process entries that contain an exact match of the filter text.
To revert to displaying all processes, clear the Filter field and press Return.
Type your search text into the Find drop-down box, or select a previously used search text from the Find drop-down list.
Your search text should be a string of characters that is common to the process entries of all of the processes you want to display.
Press Return to highlight the first occurrence of the search text below the current cursor position.
The text can be in any of the fields in the process entry.
Press Return to highlight the next occurrence, and so on.
When you have found the required process entry, clear the Find field.
When you reach the end of the scrolling pane, search does not revert to the top of the list. Therefore, to ensure you search all processes, select the first process entry in the list before typing your search text in the Find box.
By default, Process Manager lists the process entries in order of decreasing CPU usage. You can tell this because the column heading over the CPU usage column (CPU%) is depressed, while the other column headings are not.
To select the column on which the list of process entries is to be sorted, click the relevant column heading or choose the column name from the View menu.
Process Manager sorts the list of process entries and displays them in the new order. The default ordering for each column is indicated in the following table.
Table 19–1 Default Display Order for Process EntriesSelected Column Heading | Method |
---|---|
ID | Sorts numerically by process ID in increasing order |
Name | Sorts alphabetically by process name |
Owner | Sorts alphabetically by owner name |
CPU% | Sorts numerically by CPU usage in decreasing order |
RAM | Sorts numerically by RAM usage in decreasing order |
Swap | Sorts numerically by swap space usage in decreasing order |
Started | Sorts chronologically by actual start time in decreasing order |
Parent | Sorts numerically by process ID number of parent process in decreasing order |
Command | Sorts alphanumerically by full path name in decreasing order ( characters such as / have a lower sort value than letters) |
(Optional) To reverse the sort order for any one of these columns (for example, to sort by RAM usage in increasing order), click the depressed column heading button.
The column heading area will turn black and sort the display in the reverse order.
By default, Process Manager samples the workstation and updates the display every 30 seconds.
To disable/enable the continuous sampling mode, choose Stop/Start from the Sample menu.
If continuous sampling is on, you will see a Stop menu item on the Sample menu; otherwise the menu item will read Start.
To change the interval between samples, type a number of seconds (up to 604800, that is, 14 days) in the Sample Every box.
Press Return to make the new sampling frequency come into effect.
To sample immediately, choose Now from the Sample menu.
Process Manager samples and then updates the display.
You can select and copy one or more of the process entries in the display, and paste the text into other applications.
You also have the following options for saving the sample data to files:
Creating a new file containing only the current sample
Setting up a log file to which each new sample is appended
Choose Save As from the Sample Menu.
Process Manager displays the Save As dialog box.
Specify the name and location of a new file and click OK.
Process Manager creates the text file containing the process entries from the current display.
Choose Log File from the Sample menu.
Process Manager displays the Log File dialog box.
Specify the name and location of a new file and click OK.
Process Manager creates the text file and appends each new sample (with header information) to the file.
Process Manager will continue to append to this file until you terminate the Process Manager application, or until you choose Stop Logging from the Sample menu.
When you have identified and selected a process entry in the list, you can perform these actions on the process:
Send a kill signal to terminate the process or invoke a response
Search for more information about the owner in Address Manager
Trace system calls, display child processes, or run a debugger
Show its stack or its ancestors
Consult your system administrator if you do not understand the implications of carrying out any of these procedures.
The kill command in UNIX enables the user to send a signal to a process. A signal is a message sent to a process to interrupt it and cause a response. If the process has been designed to respond to signals of the type sent it does so; otherwise, it terminates. The following table lists some commonly used signal numbers/names and their meanings.
Signal No. | Signal Name | Meaning |
---|---|---|
1 | HUP | Hangup (often used before logging out) |
2 | INT | Interrupt (same as pressing Control+C in a terminal session) |
9 | KILL |
Kill (terminates without cleanup) Only works if issued by process owner or super user (root) The program cannot respond to this signal; it must terminate |
15 | TERM |
Kill (terminates gracefully after cleanup) Only works if issued by process owner or super user (root) |
The Kill menu item enables you to kill a process quickly by sending it a kill (9) signal. The Signal menu item gives you more control of the signal sent by the kill(1) command. For example you could send an INT signal or a HUP signal, and so on.
You should only send a signal to a process if you understand the implications of doing so. For example, if you select the login shell and send a kill signal, you will suddenly log out. For further information on processes and job control, contact your system administrator or see the Solaris Advanced User's Guide (Sun Microsystems).
Select a process entry in the Process Manager scrolling pane.
Choose Kill from the Process menu.
Process Manager kills the process (and its child processes) provided that you have permission to do so; otherwise an error is displayed. Sometimes it takes several seconds for the process to terminate. You can tell that a process has been killed if it is not listed the next time Process Manager updates its display.
The equivalent UNIX command is:
kill -9 PID where PID is the process ID of the selected process.
You can redefine the command performed by the Kill menu item to a different command by redefining the action labelled 'Kill' in the file:
/usr/dt/appconfig/types/C/sdtprocess.dt
Select a process entry in the Process Manager scrolling pane.
Choose Signal from the Process menu.
Process Manager displays a dialog box requesting you to specify the signals. You must supply at least one of the 42 signals defined in the signal(5) man page.
Type the relevant signal number or name and click OK.
Process Manager issues the signal command and closes the dialog box. No success message is issued. Killing a process typically kills its children.
The equivalent UNIX command is: kill -signum_name PID
where -signum_name is the signal number or name, and PID is the process ID of the selected process.
Select a process entry in the Process Manager scrolling pane.
Choose Look Up Owner from the Process menu.
Process Manager opens Address Manager and requests it to search the System Cards for the system user name of the selected process. For further details on Address Manager see Chapter 18, Using Address Manager.
Select a process entry in the Process Manager scrolling pane.
Choose Show Ancestry from the Process menu.
Process Manager displays a window containing the process trees for the specified process. Child processes are indented from the respective parent processes.
The equivalent UNIX command is:
/usr/proc/bin/ptree PID
where PID is the process ID of the selected process.
When a UNIX process initiates one or more dependent processes, we call these child processes, or children. Child and parent processes have the same user ID.
Select a process entry in the Process Manager scrolling pane.
Choose Trace Children from the Process menu.
Process Manager displays a record of the creation of any new children (and their children, recursively) for the selected process.
Error returns are reported using the error code names described in the Intro(2) man page.
The equivalent UNIX command is:
truss -fa -texec,fork -s¦CLD,ALRM -p PID
where PID is the process ID of the selected process.
During its execution, a process makes calls to the UNIX kernel, or system calls. You might want to trace these system calls to see the affect they are having on other processes.
Select a process entry in the Process Manager scrolling pane.
Choose Trace System Calls from the Process menu.
Process Manager displays a dialog box requesting you to enter optional arguments.
Click OK.
Each line of the trace output reports either the fault or signal name or the system call name with its arguments and return values. For further information, see the truss(1) man page.
The equivalent UNIX command is:
truss -p PID
where PID is the process ID of the selected process.
Select a process entry in the Process Manager scrolling pane.
Choose Show Stack from the Process menu.
Process Manager displays a window containing hexadecimal and symbolic stack trace for the selected process.
The equivalent UNIX command is:
/usr/proc/bin/pstack PID
where PID is the process ID of the selected process.
Application developers and system administrators sometimes use a debugging application such as Sun Workshop to investigate an errant process. The Debug item on the Process menu invokes your preferred debugger on the selected process.
Debug the process using your preferred debugger.
The equivalent UNIX command is:
workshop -d command
where workshop is the name of the debugger program and command is the command needed to pass the process ID to the debugger.