SV: memory Leak checking

Arne Steinarson asteinarson at yahoo.se
Tue Jul 3 01:39:45 PDT 2007


I went through some of this a while ago.

The mem leaking checking features of wxWidgets (see
memory.h) I could not get to work under Linux/GTK. 

I also tried Valgrind and there seems to be a lot of
things that are not freed correctly at a lower level.
If my app has leaks, it's difficult to find it in the
overall rather big report.

There are many other smaller solutions. A small,
practical one I found was: 

http://www.andreasen.org/LeakTracer/LeakTracer-mg.tar.gz

(Note: it is the new, separate version [by Michael
Gopstein] I found useful).

One also has to take into account how the meory tracer
works together with global object
construction/deconstruction.

Regards
// ATS



--- Lloyd <lloyd at cdactvm.in> skrev:

> Hi,
>   How can I check whether my wxWdigets application
> leaks memory? I am
> using wxGtk 2.8.4 on Linux (RHEL). So I tried using
> valgrind with this
> command to check a "hello world" like program..
> 
> $ g++ wxtemplate.cpp `wx-config --cxxflags --libs`
> -g
> $ valgrind --tool=memcheck a.out
> 
> The output is like this..
> ..........
> ..........
> ==7715== ERROR SUMMARY: 67 errors from 4 contexts
> (suppressed: 138 from
> 3)
> ==7715== malloc/free: in use at exit: 445732 bytes
> in 6487 blocks.
> ==7715== malloc/free: 25031 allocs, 18544 frees,
> 2078533 bytes
> allocated.
> ==7715== For a detailed leak analysis,  rerun with:
> --leak-check=yes
> ==7715== For counts of detected errors, rerun with:
> -v
> 
> In this case I am not allocating any memory, except
> for a frame and
> menu. What I understood from the documentation is
> that, this kind of
> allocations will be freed by wxWidgets itself. I am
> not sure how to
> check the leak, please give me some hints on leak
> checking....
> 
> Thank you very much,
>   Lloyd
> 
> 
> 
> ______________________________________
> Scanned and protected by Email scanner
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail:
> wx-users-help at lists.wxwidgets.org
> 
> 


- - -


      __________________________________________________________
Går det långsamt? Skaffa dig en snabbare bredbandsuppkoppling. 
Sök och jämför hos Yahoo! Shopping.
http://shopping.yahoo.se/b/a/c_100015813_bredband.html?partnerId=96914325





More information about the wx-users mailing list