#10262: memory leak in scalar*vector multiplication
------------------------------+---------------------------------------------
Reporter: dimpase | Owner: jason, was
Type: defect | Status: new
Priority: blocker | Milestone: sage-4.6.1
Component: linear algebra | Keywords: linear algebra, memory leak
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------------+---------------------------------------------
Comment(by dimpase):
Replying to [comment:3 jason]:
> As I mentioned on the thread, I tracked this down to a call from the
coercion system to create an element of the parent.
So {{{w}}} is a 10000 long vector over "ambient_pid_with_category". I'd
call this alone a bug, for this is horribly inefficient.
Coercion for module operation could be much better...
My guess is that "an_element()" gets memoised, and retained instead of
being destroyed at each for-loop. Indeed:
{{{
sage: for i in [1,2,3,4,1,2,3,4]:
....:
....: A=(1/2)*vector([x/2 for x in range(i*1000)])
....: get_memory_usage()
....:
261.58984375
513.59765625
1073.109375
2057.37890625
2057.37890625
2057.37890625
2057.37890625
2057.62890625
sage: for i in [1,3,5,1,3,5]:
A=(1/2)*vector([x/2 for x in range(i*1000)])
get_memory_usage()
....:
2057.62890625
2057.62890625
3614.55078125
3614.55078125
3614.80078125
3615.05078125
}}}
So we get these huge vectors clogging up the memory, in hope that someone
might want to compute in the free modules (over ambient_pid_with_category)
of these dimensions again...
Should one just turn the memoisation for modules off completely?
This would not cure the coercion inefficiency completely, but at least
would prevent this leak...
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10262#comment:4>
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.