1> PS-efo pmem, uid, PID, ppid, pcpu, comm | sort-R is implemented using the-O option of the ps command. These options include: user ruser group rgroup uid ruid GID rgid PID ppid pgid Sid taskid ctid pri opri pcpu pmem vsz RSS osz nice class time etime stime zone zoneid f s c lwp nlwp PSR tty ADDR wchan fname comm ARGs the specific meaning of projid project pset can be viewed by man ps. View Solaris memory usage, sort by memory usage PS-efo pmem, uid, PID, ppid, pcpu, comm | sort-r pmem the ratio of the process's resident set size to the physical memory on the machine, expressed as a percentage. if you do not know what options are included in this command, you can use PS help. 2> # prtconf-VP | run the grep memprtconf command in/usr/sbin to obtain the total memory. In fact, you don't have to worry about it. The top command displays more information. 3> ECHO: memstat | MDB-K for example: # echo: memstat | MDB-K
Page summary pages MB % tot
------------------------------------------------
Kernel 75297 588 7%
Anon 888409 6940 86%
Exec & libs 28196 220 3%
Page cache 15958 124 2%
Free (cachelist) 17993 140 2%
Free (freelist) 3162 24 0% total 1029015 8039
Physical 1026087 8016 explanation: kernel: Kernel pages
Anon: anonymous pages (such as stack, heap, shared mem etc)
Exec and libs: executables and libraries
Page cache: file cachefree (cachelist) + free (freelist) = freemem (free value in vmstat) This command takes a long time to run. 4> prstat-A * PID: process ID.
* Username: real user (LOGIN) Name or real User ID.
* Size: Total virtual memory size of a process, in the unit of K, M, or G.
* RSS: Process resident set size (RSS), in the unit of K, M, or G. (RSS is the size of the Process resident memory, and size is the total size of the process. Generally, the size must be greater than RSS, and the part with the size greater than RSS will be placed in the SWAp area)
* State: the State of the process (cpun/sleep/Wait/run/zombie/Stop ).
* Pri: process priority. A larger number indicates a higher priority.
* Nice: The Nice value used in priority calculation. Nice value is available only for processes in a specific scheduling class.
* Time: the cumulative execution time of the process.
* CPU: Percentage of the current CPU time used by the process. If it is executed in a non-global domain and the pool device is active, the percentage is the percentage of processors in the collection of processors used by the pool bound to the zone.
* Process: process name (name of the execution file ).
* Nlwp: the number of lwps in a process also has a parameter: the average load average of the system is in the Linux system, commands such as uptime, W, and top all have average system load average output. the final content of the command output indicates the average number of processes in the queue in the past 1, 5, and 15 minutes. As long as the number of active processes of each CPU is not greater than 3, the system performance is good. If the number of tasks of each CPU is greater than 5, it indicates that the performance of this machine has a serious problem. Load average/cpu_num <3 is good performance. By the way, run the command mpstat 5> vmstat 3 4 to check the output of vmstat. If the value of the SR column is large, memory shortage.
6> Top 7> Sar-R 5 5 The freemem marked by SAR-r shows the number of idle pages instead of K. The value is similar to vmstat.
The free memory they show also includes the memory occupied by the high-speed File Cache, which is not actually unused.
For example, vmstat displays 152528 KB of memory, Sar-r displays 18933 pages, and a page is about 8 KB. Multiply the value by 18933 by 8, or about MB. but in fact, in the real sense, the idle memory is only 6 m (measured with a dedicated memtool), rather than 152 m.