Barrys-MacBook-Pro:tutorials barrysmith$ !./ex
./ex19  -objects_dump
lid velocity = 0.0625, prandtl # = 1, grashof # = 1
Number of SNES iterations = 2
The following objects were never freed
-----------------------------------------
[0] DM da DM_0x84000000_0
      [0]  DMCreate() in /Users/barrysmith/Src/petsc-dev/src/dm/interface/dm.c
      [0]  DMDACreate() in 
/Users/barrysmith/Src/petsc-dev/src/dm/impls/da/dacreate.c
      [0]  DMDACreate2d() in 
/Users/barrysmith/Src/petsc-dev/src/dm/impls/da/da2.c
      [0]  main() in src/snes/examples/tutorials/ex19.c

The one caveat is that users who want this feature cannot use 
PetscFunctionBegin but should instead use PetscFunctionBeginUser

   Barry

Note that this is not completely trivial because in fact 36 other objects 
(created by PETSc and referenced by the DM) are also not destroyed but if we 
print them all the user won't know what they have missed.


Reply via email to