Simon King wrote:
Hi Gabriel,
On 2014-05-25, Gabriel Furstenheim Milerud <furstenh...@gmail.com> wrote:
There is a memory leak in the evaluation of multivariable polynomials:
-C.<x,y,z>=GF(2)[]
-f=x^4+x*y^3+z^6
-get_memory_usage()
.....1014.47265625
- for i in xrange(1000000):
a=f(1,0,0)
-get_memory_usage()
.....1052.47265625
Note that you first request the memory usage before assigning
"a=f(1,0,0)". But to some extend, I can confirm an increase of memory
usage (with Sage 6.2):
sage: C.<x,y,z> = GF(2)[]
sage: f = x^4+x*y^3+z^6
sage: a = f(1,0,0)
sage: get_memory_usage()
176.08984375
sage: for i in xrange(1000000):
....: a = f(1,0,0)
....:
sage: get_memory_usage()
198.08984375
sage: for i in xrange(1000000):
....: a = f(1,0,0)
....:
sage: get_memory_usage()
222.08984375
We have an increase of 22-24 megabytes in 10^6 rounds, thus 23-25 byte per
round.
Actually I wonder how such a tiny leak is even possible! In any case, it
should be fixed.
I'm getting more:
sage: import gc
sage: gc.collect()
182
sage: get_memory_usage()
292.03515625
sage: C.<x,y,z>=GF(2)[]
sage: f=x^4+x*y^3+z^6
sage: get_memory_usage()
292.19921875
sage: for i in xrange(1000000):
....: a=f(1,0,0)
....:
sage: get_memory_usage()
338.19921875
sage: gc.collect()
11
sage: get_memory_usage()
338.19921875
(Sage 6.2, MacOS X 10.6 x86_64)
-leif
--
() The ASCII Ribbon Campaign
/\ Help Cure HTML E-Mail
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.