Professional Documents
Culture Documents
Solaris
Solaris
By admin (https://www.thegeekdiary.com/author/sandeep_patil/)
Troubleshooting performance issues is an important skill every system admin must have. This post
is intended to give hints, where to look for in checking and troubleshooting memory usage. In
principle, investigation of memory usage is split in checking usage of kernel memory and user
memory.
Please be aware that in case of a memory-usage problem on a system, corrective actions usually
requires deep knowledge and must be performed with great care. First, you need to check how
much Memory is used in Kernel and how much is used in User Memory. This is important to decide,
which further troubleshooting steps are required.
A very useful mdb dcmd is ‘::memstat‘ (this command can take several minutes to complete). Below
example is from Solaris 11.2.
https://www.thegeekdiary.com/how-to-check-and-analyze-memory-usage-in-solaris/ 1/9
2/4/2019 How to Check and Analyze Memory Usage in Solaris – The Geek Diary
Succeed in negotiations
Build your global business network, negotiation
skill set and international perspective
LSE Online
User memory usage : print out processes using most USER – memory
% prstat -s size – sorted by userland virtual memory consumption.
% prstat -s rss – sorted by userland physical memory consumption.
% prstat -s rss
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
4051 user1 297M 258M sleep 59 0 1:35:05 0.0% mysqld/10
26286 user2 229M 180M sleep 59 0 0:05:07 0.0% java/53
https://www.thegeekdiary.com/how-to-check-and-analyze-memory-usage-in-solaris/ 2/9
2/4/2019 How to Check and Analyze Memory Usage in Solaris – The Geek Diary
% ipcs -a
https://www.thegeekdiary.com/how-to-check-and-analyze-memory-usage-in-solaris/ 3/9
2/4/2019 How to Check and Analyze Memory Usage in Solaris – The Geek Diary
Message Queues:
q 0 0x55460272 -Rrw-rw---- root root root root 0 0 4194304
q 1 0x41460272 --rw-rw---- root root root root 0 0 4194304
q 2 0x4b460272 --rw-rw---- root root root root 0 0 4194304
User Memory Usage : lists User Memory usage of all processes (except PID 0,2,3)
# pmap -x /proc/* > /var/tmp/pmap-x
https://www.thegeekdiary.com/how-to-check-and-analyze-memory-usage-in-solaris/ 4/9
2/4/2019 How to Check and Analyze Memory Usage in Solaris – The Geek Diary
% df -kl /tmp
Filesystem kbytes used avail capacity Mounted on
swap 1355552 2072 1353480 1% /tmp
% vmstat -p 3
memory page executable anonymous filesystem
swap free re mf fr de sr epi epo epf api apo apf fpi fpo fpf
19680912 27487976 21 94 0 0 0 0 0 0 0 0 0 14 0 0
https://www.thegeekdiary.com/how-to-check-and-analyze-memory-usage-in-solaris/ 5/9
2/4/2019 How to Check and Analyze Memory Usage in Solaris – The Geek Diary
3577608 11959480 0 20 0 0 0 0 0 0 0 0 0 0 0 0
3577328 11959240 0 5 0 0 0 0 0 0 0 0 0 0 0 0
3577328 11959112 38 207 0 0 0 0 0 0 0 0 0 0 0 0
3577280 11958944 0 1 0 0 0 0 0 0 0 0 0 0 0 0
% swap -s
total: 399400k bytes allocated + 18152k reserved = 417552k used, 1355480k available
alternatively to kstat you can get kernel memory usage with kmastat prints kmastat bu ers.
https://www.thegeekdiary.com/how-to-check-and-analyze-memory-usage-in-solaris/ 6/9
2/4/2019 How to Check and Analyze Memory Usage in Solaris – The Geek Diary
% more /var/tmp/kmastat
cache buf buf buf memory alloc lloc
name size in use total in use succeed fail
------------------------- ------ ------ ------ --------- --------- -----
kmem_magazine_1 16 470 508 8192 470 0
kmem_magazine_3 32 970 1016 32768 1164 0
kmem_magazine_7 64 1690 1778 114688 1715 0
Look for the highest numbers in column “memory in use” and for any numbers higher than ‘0’ in
column “alloc fail”.
Y O U M AY A L S O L I K E
https://www.thegeekdiary.com/how-to-check-and-analyze-memory-usage-in-solaris/ 7/9
2/4/2019 How to Check and Analyze Memory Usage in Solaris – The Geek Diary
CHEAT SHEETS
https://www.thegeekdiary.com/how-to-check-and-analyze-memory-usage-in-solaris/ 8/9
2/4/2019 How to Check and Analyze Memory Usage in Solaris – The Geek Diary
https://www.thegeekdiary.com/how-to-check-and-analyze-memory-usage-in-solaris/ 9/9