#13741: Proper deallocation of the (unique) pari instance
-------------------------------------+--------------------------------------
       Reporter:  SimonKing          |         Owner:  rlm         
           Type:  defect             |        Status:  needs_review
       Priority:  blocker            |     Milestone:  sage-5.5    
      Component:  memleak            |    Resolution:              
       Keywords:  pari deallocation  |   Work issues:              
Report Upstream:  N/A                |     Reviewers:              
        Authors:  Simon King         |     Merged in:              
   Dependencies:                     |      Stopgaps:              
-------------------------------------+--------------------------------------

Comment (by jpflori):

 I think so.

 The only other "proper" solution I see is to gather all allocation made at
 the top level of gen.pyx into a global function or a member function of
 PariInstance, and call this function from the top level after the
 PariInstance is initialized.
 (This part part might be optional, we could just list them for
 deallocation below).
 Then define a counter part to this function which would deallocate these
 objects.
 And for our test we would first call this last function, then del the pari
 unique instance, then reinit it (provided the PARI lib really supports
 that, but that seems plausible).
 But that would only work if no things outside of gen.pyx directly use the
 unique pari instance (or at least no other things that would get
 initialized by the doctest framework), as far as I know and flint is
 concerned, there are several places in Sage code where the FLINT memory is
 accessed making an approach as suggested above impossible in the case of
 FLINT, maybe not in a doctesting context, but for general use of Sage.

 All that said, deallocation of gen's does not involve the Pari instance
 they were created with, and the memory they use does not belong to PARI
 (i.e. PARI will not try to deallocate this memory when quitting, what
 FLINT would do following my above remarks), but the fact that at the
 python level they have a reference to this instance would make calling
 "del" on the unique Pari instance useless unless we proceed as above and
 first delete all these global gen's automatically created when importing
 gen.pyx.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13741#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to