LWN.net Logo

CLI Magic: Linux troubleshooting tools 101 (Linux.com)

CLI Magic: Linux troubleshooting tools 101 (Linux.com)

Posted Feb 19, 2007 19:39 UTC (Mon) by Ross (subscriber, #4065)
In reply to: CLI Magic: Linux troubleshooting tools 101 (Linux.com) by aisotton
Parent article: CLI Magic: Linux troubleshooting tools 101 (Linux.com)

For memory-leak problems you might also use:
ipcs # shared memory or other IPC leaks
xrestop # X resource leaks
memstat # memory usage by process and file

Lots of "development" tools can also be useful for finding crashes or
memory leaks:
gdb
valgrind

glibc also has some environmental variables to help find (or work around) buggy usage of malloc/free:
MALLOC_CHECK_=0 # heap corruption ignored
MALLOC_CHECK_=1 # heap corruption printed to stderr
MALLOC_CHECK_=2 # heap corruption causes abort()

Also, just doing ls -l in /proc/<pid>/fd can be enlightening when trying
to figure out what a program is doing.

-Ross


(Log in to post comments)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.