Closed jfowkes closed 1 year ago
Could I just check ... you are calling uterminate/cterminate at the end of you run. This is supposed to deallocate everything. It is possible, of course, that there is something missing in uterminate, and if so I need to investigate !
Ahh the interface is not (looks like this wasn't implemented in the original pycuter) that would explain all the memory leaks!
Excellent. I hope that does the trick.
As discovered by a PyCUTEst user, there appear to be memory leaks in CUTEst (accessed via C interface), valgrind reports:
and many more (3,064) such leaks in
cutest_usetup
andcutest_udimsh
(all that I tested).While this may not seem significant it very quickly adds up when one loops over several different problems!
From the traceback it is clear that these leaks are coming from the Fortran (namely the functions
cutest_allocate_array_integer
,cutest_usetup_threadsafe
, andcutest_initialize_workspace
in this snippet) possibly automatic array deallocation is failing for some reason? It is probably worth running both the Fortran and C interfaces tocutest_usetup
andcutest_udimsh
throughvalgrind
or-fsanitize=address
to test for these memory leaks.