public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Greg Newby <gbnewby@ils.unc.edu>
To: help-gcc@gnu.org
Subject: Re: Memory Leaks
Date: Tue, 30 Nov 1999 23:28:00 -0000	[thread overview]
Message-ID: <81svne$duu$1@fddinewz.oit.unc.edu> (raw)
Message-ID: <19991130232800.qYTxId7uRU_tdUyQ1PzHLO2AgxT8dbzLfRo-HOUHU94@z> (raw)
In-Reply-To: <rmcc18.vu6.ln@127.0.0.1>

There's a great commercial tool called Purify, made by
Rational (www.rational.com).  It's quite pricey ($2400 license),
but you can download a free demo.

It searches for all memory leaks, potential memory leaks, etc.
and tells you where in your code they happen.  Very handy...

I wish I could afford it (we might get an educational version
here at UNC soon).  Meanwhile, I periodically download the 
demo version when I'm having trouble that debuggers can't find.

This doesn't answer your question, but it's a good tool to know
about I think.  It interoperates fine with gdb (that's how I 
use it).  I have not had much luck looking for memory leaks with
gdb - although you can spot a variable that points to unassigned
memory easily enough (e.g., if *p == NULL [0x0]), it doesn't do this
automatically.  Furthermore, it doesn't enforce any kind of 
coding practice, like making sure stuff you 'new' or 'malloc' is
later free'd. 

  -- Greg

In gnu.g++ J.H.M. Dassen (Ray) <jhm@cistron.nl> wrote:
> Fred Wan <a.wan@cable.A2000.nl> wrote:
>>Does anyone know if there are possibilities of tracing memory leaks with
>>gdb (xxgdb)?

// Gregory B. Newby, Assistant Professor in the School of Information
// and Library Science, University of North Carolina at Chapel Hill
// CB# 3360 Manning Hall, Chapel Hill, NC, 27599-3360  E: gbnewby@ils.unc.edu
// V: 919-962-8064 F: 919-962-8071  W: http://www.ils.unc.edu/~gbnewby/

  parent reply	other threads:[~1999-11-30 23:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <383536D0.C1DA51E8@cable.A2000.nl>
     [not found] ` <rmcc18.vu6.ln@127.0.0.1>
1999-11-26  9:30   ` Philip Brown
1999-11-30 23:28     ` Philip Brown
1999-12-02  6:38     ` Paul Scott
1999-12-31 22:24       ` Paul Scott
1999-11-28 21:07   ` Greg Newby [this message]
1999-11-30 23:28     ` Greg Newby
1999-11-19  5:09 Fred Wan
1999-11-19 13:02 ` Erik de Castro Lopo
1999-11-30 23:28   ` Erik de Castro Lopo
1999-11-30 23:28 ` Fred Wan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='81svne$duu$1@fddinewz.oit.unc.edu' \
    --to=gbnewby@ils.unc.edu \
    --cc=help-gcc@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).