Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Aix to view processes with high memory footprint

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1, arranging 10 memory utilization processes from large to small

Ps aux | head-1; ps aux | sort-rn + 3 | head-10

For example, check the process in detail:

Ps-ealf | head-1; ps-ealf | sort-rn + 9 | head-1 ps aux | head-1 Ps aux | sort-rn + 3 | head-10USER PID% CPU% MEM SZ RSS TTY STAT STIME TIME COMMANDroot 6553834 0.1 115064 115080-A Feb 20 86:08 / var/opt/tivoliroot 5701730 1.0 17480 21956-A Mar 05 1:17 / opt/BESClient/pconsole 4456680 0.0 1.0 42456 42464-A Feb 20 3:11 / usr/java5/bin/root 6750376 0.0 796 824 pts/0 A 11:29:26 ps auxroot 6488234 0.000. 0 260 268-A Mar 13 0:02 auditbinroot 6357208 0.0 0.0236 248 pts/0 A 11:29:26 0:00 sort-rn + 3root 5963962 0.0 1768 1804-A Feb 20 0:00 / usr/sbin/rsct/root 5832798 0.0 836 856-A 11:29:12 telnetd-aroot 5570748 0.00.02128 2096-A Feb 20 0:00 / usr/sbin/rsct/root 5308652 0.0 7328 7436-A Feb 20 1:01 / usr/sbin/rsct/

2. View memory usage based on a command or process name

# ps aux | head-1; ps aux | grep topas

For more information, please see:

USER PID% CPU% MEM SZ RSS TTY STAT STIME TIME COMMANDroot 2359426 0.0 1440 1272-A Feb 20 1:08 / usr/bin/topasrroot 6160578 0.0 252 264 pts/0 A 11:36:45 0:00 grep topas

But sometimes ps aux does not show the full utilization of the process in great detail.

3. Memory usage can be analyzed by root users and svmon users.

# svmon-Gsize inuse free pin virtual mmodememory 1048576 1037487 11089 229668 378796 Dedpg space 2097152 2360work pers clnt otherpin 196952 00 32716in use 378796 0 658691PageSize PoolSize inuse pgsp pin virtuals 4 KB-793327 2360 49188 134636m 64 KB-15260 011280 15260

Inuse: physical memory usage, which is measured in 4K, so 103748740964249546752 (424m)

Virtual: virtual memory usage, here is 4K, so 37879640961551548416 (155m)

4, showing the three processes that use the most physical memory:

# svmon-uP-t 3 | grep-p Pid | grep'^. * [0-9] '6553834 java 51279 8917 0 50938 N Y N4456680 java 34626 8874 034608 N Y N5701730 BESClient 29564 8882 025689 Y Y N

The format order of the output is Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd

It can be calculated that the real memory used by the X program is 51279 × 4096mm 210038784, which is about 210MB.

5, showing the three processes that use the most physical memory in the swap area

# svmon-gP-t 3 | grep-p Pid | grep'^. * [0-9] '1966206 shlap64 26782 8880 0 26771 Y N N 0 swapper 9872 8912 0 9872 Y N N 1 init 22094 8836 0 22076 N N N

The swap area used by the first program X is about 26782 × 4096 = 10510336 bytes, which is about 10MB space.

6, showing the most used segments every three seconds

# svmon-S-t 3-I 3Vsid Esid Type Description Inuse Pin Pgsp Virtual4f08-clnt 37505 0-11e1-clnt 33623 0-8811-work kernel pinned heap 12637 6547 8091 19397

It can be seen that the segments whose Vsid is 4f08 are most used.

7 Svmon-pP 22674

See what files are used by processes with a PID of 22674

Pid Command nuse Pin Pgsp Virtual 64-bit Mthrd22674 java 29333 1611 2756 32404 N YVsid Esid Type Description Inuse Pin Pgsp Virtual0 0 work kernel seg 2979 1593 1659 4561a056-work 43 16 3 461e03 2 work process private 77 2 17 931080-pers / dev/hd2:69742 10-- f8bd f work shared library data 84 011 9960ee 8 work shmat/mmap 2000 070ec-pers / dev/hd2:69836 10--

8. Check which files are used by Vsid through the ncheck command.

Ncheck a056

View the total physical memory

# cat mem1. Echo echo mem totle: "echo $totalmem MBecho" (echo-v | head-n 1 | awk'{print $1bot 256}')

Check the amount of physical memory occupied by each user

# cat mem2.shusermem=$ (for username in `cat / etc/passwd | awk-F:'{print $1} '`dosvmon-U $username | grep $username "" done) usermem= `echo "$usermem" | grep-v "0000" | awk' {print $1ZR 2256, "MB"} '`echo "singe user pmem" echo "$usermem" usermem=$ (echo "$usermem" | awk' BEGIN {sum1=0;} {sum1=sum1+$2;} END {print sum1;}') usermem=$ (echo $usermem | awk-F\. '{print $1}') echo "singe user pmem:" $usermem MBecho

Check the amount of memory occupied by system, user and file system under AIX5.3

#! / usr/bin/ksh# check the total amount of memory: totalmem=$ (vmstat-v | head-n 1 | awk'{print $1max 256}') echo "Total memory (physical memory):" echo $totalmem MBecho# View the memory used by each user: usermem=$ (for username in `memory / etc/passwd | awk-F:'{print $1} '`dosvmon-U $username | grep $username "" done) usermem= `echo "$usermem" | grep-v "0000" | awk' {print $1cr 2256 MB " "MB"} '`echo "user memory (physical memory):" echo "$usermem" usermem=$ (echo "$usermem" | awk' BEGIN {sum1=0) } {sum1=sum1+$2;} END {print sum1;}') usermem=$ (echo $usermem | awk-F\. '{print $1}') total user memory (physical memory): "$usermem MBecho# view file system cache: clientmem1= `svmon-G | grep" ^ pin "| awk'{print $4} '`clientmem2= `svmon-G | grep" ^ in use "| awk' {print $5} '`clientmem= `expr $clientmem1 + $clientm em2`clientmem = `expr $clientmem / 256`echo" File system cache (physical memory): "echo $clientmem MBecho# View system memory: sysmem=$ (svmon-S-s-u | cut-b-54-| grep-v" 0 00 "| grep [0-9] | awk' {print $1) $2}') supremeseg= `echo "$sysmem" | grep S | awk 'BEGIN {sum1=0 } {sum1=sum1+$2;} END {sum1=sum1*16*1024*1024;print sum1;} '`largeseg= `echo "$sysmem | grep L | awk' BEGIN {sum1=0;} {sum1=sum1+$2;} END {sum1=sum1*16*1024;print sum1;} '`mediumseg= `echo" $sysmem "| grep m | awk' BEGIN {sum1=0;} {sum1=sum1+$2;} END {sum1=sum1*64;print sum1;} '`smallseg= `echo" $sysmem "| grep s | awk' BEGIN {sum1=0;} {sum1=sum1+$2;} END {sum1=sum1*4;print sum1 } '`sysmem=$ (expr $supremeseg + $largeseg + $mediumseg + $smallseg) sysmem=$ (expr $sysmem / 1024) echo "system memory (physical memory):" echo $sysmem MBecho# View Free memory: freemem=$ (vmstat-v | grep free | awk' {print $1q256}') echo "Free memory (physical memory):" freemem=$ (echo $freemem | awk-F\. '{print $1}') echo $freemem MBecho

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report