[petsc-users] Using -malloc_dump to examine memory leak

Yuyun Yang yyang85 at stanford.edu
Tue Apr 16 01:14:07 CDT 2019


Hello team,

I'm trying to use the options -malloc_dump and -malloc_debug to examine memory leaks. The messages however, are quite generic, and don't really tell me where the problems occur, for example:

[ 0]1520 bytes VecCreate() line 35 in /home/yyy910805/petsc/src/vec/vec/interface/veccreate.c
      [0]  PetscMallocA() line 35 in /home/yyy910805/petsc/src/sys/memory/mal.c
      [0]  VecCreate() line 30 in /home/yyy910805/petsc/src/vec/vec/interface/veccreate.c
      [0]  VecDuplicate_Seq() line 804 in /home/yyy910805/petsc/src/vec/vec/impls/seq/bvec2.c
      [0]  VecDuplicate() line 375 in /home/yyy910805/petsc/src/vec/vec/interface/vector.c

The code is huge, so going through every single VecCreate/VecDuplicate and VecDestroy is going to be time-consuming. Meanwhile, running valgrind gave me some uninitialized values errors that don't seem to be related to the above message (or maybe they are?).

How can I use this option to debug effectively?

Thanks a lot,
Yuyun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190416/e44bbc6e/attachment.html>


More information about the petsc-users mailing list