[petsc-dev] writing PETSc code with no memory leaks

Barry Smith bsmith at mcs.anl.gov
Mon May 9 21:27:11 CDT 2011


   I find it very useful when writing PETSc code to keep the environmental variable 

export PETSC_OPTIONS="-malloc -malloc_debug -malloc_dump"

where I run my test programs. This helps me see memory leaks immediately (where I forgot to destroy some objects or free some memory) rather than tracking down a ton of memory leaks months later. Suggest others do the same.


   Barry





More information about the petsc-dev mailing list