#9129: sqrt memory leaks
------------------------------------+---------------------------------------
       Reporter:  zimmerma          |         Owner:  AlexGhitza
           Type:  defect            |        Status:  new       
       Priority:  critical          |     Milestone:  sage-5.1  
      Component:  basic arithmetic  |    Resolution:            
       Keywords:  sd35.5            |   Work issues:            
Report Upstream:  N/A               |     Reviewers:            
        Authors:                    |     Merged in:            
   Dependencies:                    |      Stopgaps:            
------------------------------------+---------------------------------------

Old description:

> cf http://groups.google.com/group/sage-
> support/browse_thread/thread/8c18b2b91004c35a#:
> {{{
> sage: m = get_memory_usage()
> sage: while True:
>     a = ZZ(randint(2^400,2^800)).sqrt()
>     print get_memory_usage(m)
> }}}
> I noticed another sqrt-related memory leak:
> {{{
> sage: cat leak.sage
> for i in range(10^6):
>    Mod(2^32+1,3).sqrt()
>    if i % 10000 == 0:
>       print i, get_memory_usage()
> sage: load leak.sage
> 0 947.37109375
> 10000 970.4375
> 20000 993.8671875
> 30000 1017.25
> 40000 1040.734375
> 50000 1064.19921875
> ...
> }}}
> This leaks about 23Mb per 10^^4 loops, thus about 2.3Kb per loop!

New description:

 cf http://groups.google.com/group/sage-
 support/browse_thread/thread/8c18b2b91004c35a#:
 {{{
 sage: m = get_memory_usage()
 sage: while True:
     a = ZZ(randint(2^400,2^800)).sqrt()
     print get_memory_usage(m)
 }}}
 or simpler:
 {{{
 m = get_memory_usage()
 i=0
 while True:
     i+=1
     a = 2.sqrt()
     if i%1000==0:
         print get_memory_usage(m)
 }}}

--

Comment (by zimmerma):

 I updated the description.

 Paul

 PS: it seems the "stopgaps" were deleted, but I don't know which value it
 was...

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9129#comment:24>
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