[svlug] Debugging memory problems

Sanatan Rai sanat at stanford.edu
Thu Jan 17 01:17:02 PST 2002


Thanks! This was most helpful.

--Sanatan
:
: In my experience, the way the Solaris memory manager works,
: it can run some programs that horribly corrupt the memory space,
: at they still seem to run fine.  Linux, Windows, HPUX, etc are much
: less forgiving if the program does something bad to its memory.
:
: Linux Journal and Linux Magazine both had articles within about the
: last year on debugging memory issues, and mentioned numerous
: free and commercial tools.
:
: The first thing to try is setting the environment variable
: MALLOC_CHECK_ to 1 or 2 and then try running your code. Here's some
: data about doing this:
: http://sdb.suse.de/sdb/en/html/aj_debug.html
:
: Another thing which could be a problem is running out of stack
: space.  If you allocate large arrays of data on the stack,
: i.e. as local variables in functions, you might be eating up all
: your stack space.  You can check and change the amount of
: stack space that your process can use with the limit (csh) or
: ulimit (sh) commands.

 <rest snipped>

-- 
Sanatan Rai,                      | E.-mail: sanat at stanford.edu
Dept. of Management Sc. & Engg.   | Home: 100 N. Whisman Road 4316,
Stanford University,              |       Mountain View, Ca 94043.
Stanford, Ca 94305.               | 'phone: (650) 964 0220 (R)
EMail: sanat at stanford.edu                   (650) 736 2109 (O)





More information about the svlug mailing list