memory Leak checking

Lloyd lloyd at cdactvm.in
Mon Jul 2 23:18:55 PDT 2007


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




More information about the wx-users mailing list