[ADOL-C] Memory leak when using sparse_jac
kshitij at math.upb.de
Tue Mar 29 11:50:34 EDT 2011
the first 6 error messages are due to using delete for deallocating
memory that was allocated using a malloc/calloc. You should call free()
instead in your NewtonRelax.cpp for all the pointers that are returned
from ADOL-C sparse_jac call (rind, cind and values).
Also, I would recommend you to use the current svn trunk (rev. 206) of
ADOL-C along with ColPack-1.0.3. Several memory related issues have been
fixed and the internal memory management has been completely revamped
recently (after the 2.1.12 release) which will be released in the next
release along with a lot of other new features in the near future.
Please run valgrind and send us the log using this version, in case
there are still some leaks that do not show up in our tests, we will be
happy to fix them.
As on 2011-03-29 14:20, heinrich at ma.tum.de did write:
> Hello everybody,
> I am using ADOL-C and especially the function sparse_jac within a
> Navier-Stokes solver. As I am doing shape optimization at the moment I
> have to call the solver (and consequently sparse_jac) many (hundreds of)
> times. I observed that the required memory is getting bigger and bigger,
> which finally leads to a crash of the whole program (even on a big machine
> with plenty of memory). I located the problem in the function sparse_jac.
> The output of valgrind after 9 calls of sparse_jac is the following:
Dr. Kshitij Kulshreshtha
Institut für Mathematik,
Warburger Straße 100,
More information about the ADOL-C