Opened 3 years ago

Last modified 3 years ago

#22164 closed defect

Memory leaks in eclib interface — at Version 3

Reported by: cremona Owned by:
Priority: major Milestone: sage-7.6
Component: interfaces Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Fixed upstream, in a later stable release. Work issues:
Branch: Commit:
Dependencies: #22077, #10256 Stopgaps:

Description (last modified by jdemeyer)

As originally reported at https://ask.sagemath.org/question/36225/memory-leak-with-modular-symbols/

The interface from Sage to eclib introduces memory leaks since C++ objects are created but not destroyed. In all but one place there is an appropriate dealloc method, but not for class ECModularSymbol.

Here is a list, hopefully complete, all from sage.libs.eclib:

  • In homspace.pyx, the initializer for class ModularSymbols? calls new to create a C++ homspace, which is correctly deallocated
  • In mat.pyx, C++ matrices are created but again there is a dealloc to delete them.
  • In newforms.pyx, the initializer for class ECModularSymbol calls new newforms() and has no dealloc method.

This one is good:

  • In mwrank.pyx the initializer for class _Curvedata creates a C++ Curvedata via new which is correctly deallocated. Same for class _mw with a new nw. Same for class _two_descent and new two_descent.

Change History (3)

comment:1 Changed 3 years ago by cremona

  • Dependencies set to #22077, #10256

I added #22077 and #10256 as dependencies since they make many changes in sage.libs.eclib, but as they have missed release 7.5 (I assume) someone might consider it urgent to fix this leak before 7.5 despite that.

comment:2 Changed 3 years ago by cremona

  • Description modified (diff)

comment:3 Changed 3 years ago by jdemeyer

  • Description modified (diff)

homespace? Sounds cool :-)

Note: See TracTickets for help on using tickets.