[openbeos] Re: Memory Leak Detector

  • From: "Scott MacMaster" <zqxh@xxxxxxx>
  • To: <openbeos@xxxxxxxxxxxxx>
  • Date: Fri, 1 Nov 2002 18:20:14 -0500

There is a built in memory leak detector.  You activate it by setting a
variable in the terminal and the running your program.  When you program
ends a report is generated.  I don't remember how to do it but I'm sure
someone on the list does.

However, its really only useful if you're using malloc and free.  If you use
new and delete the BeAPI causes a lot of false reports of memory leaks which
makes scanning through the listed of reported memory leaks to find your
memory leaks rather difficult.  Also, since the report is displayed in the
terminal a long list will overfill the terminal so you can't view the
beginning of the list.  It might be possible to redirect the output to a
file so the second issue may not be an issue.

The common way of implement a leak detector within your source is too
overload new and delete.  Unfortunately, the BeAPI prevents this because
BMessage overrides new and delete.  So the only way to implement a leak
detector within your source is too make function similar to new and delete
(example, NEW and DELETE) and remember to use them instead of new and
delete.

I'm mostly replying because I would like to ask OpenBeOS to implement the
leak checker so that it is a better than the current.


Scott MacMaster

----- Original Message -----
From: "Mahmoud Al Gammal" <obos@xxxxxxxxxxx>
To: <openbeos@xxxxxxxxxxxxx>
Sent: Friday, November 01, 2002 7:09 AM
Subject: [openbeos] Memory Leak Detector


> Is there a good memory leak detector I could use under BeOS? Is there
> something similar to Valgrind http://developer.kde.org/~sewardj/ for
example
> that can be run directly on binaries? If not, then would you consider
adding
> such tool to the OpenBeOS todo list? I think it would be very useful to
> everyone here
>
> Thanks,
> Mahmoud Al Gammal
>
>
>


Other related posts: