Title's three fields are explained below the man top, but they are somewhat ambiguous, and it is difficult to understand how they are specific to the resource usage of the process. After reviewing the information, summarize.
VIRT:
1. The process "required" virtual memory size, including the library, code, data, etc. used by the process
2, if the process to apply for 100m of memory, but the actual use of only 10m, then it will grow 100m, rather than the actual use of the volume
Res:
1. The memory size currently used by the process, but does not include swap out
2. Sharing with other processes
3, if the application of 100m of memory, the actual use of 10m, it only grows 10m, and virt opposite
4, about the memory consumption of the library, it only statistics the size of the loaded library file memory
Shr:
1, in addition to the shared memory of the process itself, also includes the shared memory of other processes
2, although the process uses only a few shared library functions, but it contains the entire size of the shared library
3. Calculate the physical memory size formula that a process occupies: res–shr
4, swap out, it will be lowered
Unix/linux Process Management Related command introduction
A process is an entity that the operating system uses to control system resources. Unix/linux process Management related commands are mainly as follows, and some commands are used in later script implementations.
Show Process Properties command
PS Command: This command is the most basic and very powerful process view command for reporting process identities, users, CPU time consumption, and other properties. It can be used to determine which processes are running and running, whether the process is complete, if the process is dead, which processes are consuming too much resources, and so on. The PS command can monitor the work of the background process because the background process is not communicating with these standard input/output devices on the on-screen keyboard, and you can use the PS command if you need to detect the situation.
The list of processes that are seen by using the PS command alone is a process performed in the foreground, but not all processes are performed in the foreground, and many processes are hidden in the background. Use the command ps-e to display all processes.
Process Performance Detection commands
Top command: Linux uses the top command to show the CPU usage as the first few processes. The command can sort tasks by CPU usage, memory usage, execution time, and many of the features of the command can be set through interactive commands or in personal customization files. The top main field has the following meanings:
table 1. Top Field meaning
Column Name |
meaning |
Pid |
Process ID |
USER |
User name of the process owner |
PR |
Task priority |
NI |
Nice value. A smaller number indicates a higher priority, and a larger value indicates a lower priority level |
VIRT |
Total amount of virtual memory used by the process, in kilobytes. Virt=swap+res |
Res |
The amount of physical memory, in kilobytes, that the process used, not swapped out. Res=code+data |
Shr |
Shared memory size, in kilobytes: KB |
S |
Process state. d= non-disruptive sleep state R= Run S= Sleep t= Tracking/Stopping z= Zombie Process |
%cpu |
CPU time consumption percentage last updated to current |
time+ |
Total CPU time used by the process, accurate to 1/100 seconds |
COMMAND |
Command name/command line |
Topas command: AIX uses the Topas command to report critical statistics about the activity on the local system, including the process that shows the CPU usage, on the character terminal. The Topas command extracts and displays statistics from the system at the default two-second interval. The command topas-p can be entered into the Topas process sub-section to display a list of active processes. The processes are sorted by their CPU usage during the monitoring interval. Topas The fields displayed for each process have the following meanings:
The meaning of virt,res,shr under Linux