finding memory leaks for Solaris applications
By ydzhang on 十二月 21, 2007
using ksh, to find leaks in 'iostat' utility
LD_PRELOAD=libumem.so;UMEM_DEBUG=default;UMEM_LOGGING=transaction; export LD_PRELOAD UMEM_DEBUG UMEM_LOGGING
truss -fT exit -t \\!all -s \\!all /usr/bin/iostat -xYn > /dev/null <<displays pid ##### at exit time>>> echo "::findleaks -d" | mdb -p `pgrep iostat`;prun `pgrep iostat`
[]
example of fmdump -t [time]
for gettimeopt function:
bash-3.2# truss -fT exit -t \\!all -s \\!all /fmdump -t 10:20:11 > /dev/null 102205: _exit(0) bash-3.2# echo "::findleaks -vd" |mdb -p 102205;prun 102205
[]
Memory Leak Testing Steps for fmdump
bash-3.2# truss -fT exit -t \\!all -s \\!all /fmdump -e -n class=\*scsi\* -n ena=b > /dev/null << pid #>> bash-3.2# echo "::findleaks -vd" |mdb -p <<pid #>>;prun <<pid #>>