#18385: deallocate pari when sage quits
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_info
           Type:         |    Milestone:  sage-6.7
  defect                 |   Resolution:
       Priority:  major  |    Merged in:
      Component:         |    Reviewers:
  memleak                |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  9bb69f848059d05ecb6566fa99d6e5d0624b6fa1
Report Upstream:  N/A    |     Stopgaps:
         Branch:         |
  public/18385           |
   Dependencies:         |
-------------------------+-------------------------------------------------

Comment (by nbruin):

 Replying to [comment:9 jdemeyer]:
 > The problem isn't that `pari` is never deallocated, the problem is
 apparently that Cython global variables are never deallocated.

 A little googling gives me the impression that this is a wide-spread
 problem with python (extension) modules: there is no way to "unload" a
 module (which would be the time to deallocate global variables), and it
 seems it doesn't exist because people haven't been able to solve the
 subtle problems that arise in deciding when and in what order unloading
 should happen (especially extension modules seem to be complicated this
 way)

 Indeed, without extra information, the fact that arbitrary code could be
 executed upon deallocation means there is no sure-fire way to decide a
 correct way to order module deallocation. It wouldn't be hard to write 2
 modules A and B such that the deallocation code of one requires the other
 module to be functional. One would require a rather careful protocol
 specification to allow module deactivation.

 Without extra information, you cannot start deallocating global variables
 unless you know the module has been "deactivated". So I think Cython in
 general will not be solving this problem any time soon.

--
Ticket URL: <http://trac.sagemath.org/ticket/18385#comment:10>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to