Potential memory leak in XLALSimInspiralTofV()
@koustav.chandra and I noticed a dramatic memory leak when repeatedly calling XLALSimInspiralTaylorLength()
from Python (this was in pycbc_optimal_snr
). Replacing the call with a dummy constant value makes the leak go away.
On a quick inspection of the function definition, I found that XLALSimInspiralTofV()
allocates a gsl_integration_workspace
(via gsl_integration_workspace_alloc()
) but it does not free it (link to code). I am not very familiar with GSL, but presumably the function should call gsl_integration_workspace_free()
after using the result?