#4639: bad memory leak with exponentiation
------------------------------+---------------------------------------------
 Reporter:  bober             |        Owner:  somebody  
     Type:  defect            |       Status:  new       
 Priority:  blocker           |    Milestone:  sage-3.2.2
Component:  basic arithmetic  |   Resolution:            
 Keywords:                    |  
------------------------------+---------------------------------------------
Comment (by robertwb):

 An interesting test point:

 {{{
 class TestParent(Parent):
     def __init__(self):
         self._populate_coercion_lists_()
     def _has_coerce_map_from_(self, X):
         return True
     def _element_constructor_(self, x):
         raise TypeError
 }}}

 Now this leaks

 {{{
 %python

 from sage.all import get_memory_usage

 def test(R, S):
     mor = S.convert_map_from(R)
     print get_memory_usage()
     for i in range(10000):
         try:
             mor = S.convert_map_from(R)
             a = mor._call_(R.gen())
         except:
             pass
     print get_memory_usage()
 }}}

 But this doesn't

 {{{
 %cython

 from sage.all import get_memory_usage

 def test(R, S):
     mor = S.convert_map_from(R)
     print get_memory_usage()
     for i in range(10000):
         try:
             mor = S.convert_map_from(R)
             a = mor._call_(R.gen())
         except:
             pass
     print get_memory_usage()
 }}}

 The *only* difference here is Python vs. Cython (leaking in the Python
 case).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4639#comment:17>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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