Wednesday, 5 January 2005

Solaris: Tips

* To approximate the amount of memory being used by the kernel:

kstat | grep pp_kernel | awk '{ print ($2*8192)/(1024*1024), "MB"; }'



* Kernel memory usage breakdown:

echo "::memstat" | mdb -k (as "root")



Page Summary Pages MB %Tot

------------ ---------------- ---------------- ----

Kernel 122064 953 12%

Anon 147000 1148 15%

Exec and libs 14329 111 1%

Page cache 54188 423 5%

Free (cachelist) 547198 4274 55%

Free (freelist) 115649 903 12%



Total 1000428 7815



* Using alternative ld.so (on Solaris 9 or later versions):

LD_LIBRARY_PATH=/path/as/needed /path/to/alternative/ld.so.1 /path/to/executable



* To force 64-bit linker use:

export LD_ALTEXEC=/usr/ccs/bin/sparcv9/ld



* Stack trace using mdb:

echo '::stack'|mdb core



* Use prstat -m to determine if the system has a memory shortage. Scan processes and check the amount of time they are sleeping on page-in; this is visible via the datafault microstate, visible from prstat -m as DFL. As a rule of thumb, if processes are spending more than 5% of their wall clock time in data faults, then there is a memory shortage. This method gives a true indication how much slower a process is running due to memory pressure

No comments:

Post a Comment