<div class="gmail_quote">On Sun, Nov 13, 2011 at 16:29, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":44o"> I have PETSC_OPTIONS set in my .bashrc file to -malloc -malloc_debug -malloc_dump by default.<br>
<br>
 This means when I introduce memory leaks I find them immediately.  Like someone just introduced in src/dm/examples/test/ex30.c but did not detect because they did not have these options set.</div></blockquote></div><br>
<div>This is my fault. In DMDestroy(), there is somewhat strange logic to count the number of circular references in the "gotten" vectors.</div><div><br></div><div>DMSliced clones new Vecs off of it's own private Vec, which has yet another circular reference. Should we just artificially decrement the reference count on the DM, and then re-reference it in DMDestroy_Sliced before destroying slice->globalvector? I wonder if there is a more elegant way to handle these circular references.</div>