#14159: Don't install callbacks on values of TripleDict, MonoDict
------------------------------+---------------------------------------------
Reporter: nbruin | Owner: tbd
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.8
Component: memleak | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Nils Bruin
Authors: Simon King | Merged in:
Dependencies: | Stopgaps:
------------------------------+---------------------------------------------
Comment (by nbruin):
A little data point for how this change might adversely affect memory and
speed performance. Running
{{{
import resource
R=[ZZ.quo(3^n) for n in [1..1000]]
def test(R):
for i in range(len(R)):
print i
for j in range(i,len(R)):
H=Hom(R[j],R[i])
%time test(R)
resource.getrusage(resource.RUSAGE_SELF)
}}}
Reference:
{{{
resource.struct_rusage(ru_utime=50.020395, ru_stime=0.16497399999999998,
ru_maxrss=130108, ru_ixrss=0, ru_idrss=0, ru_isrss=0, ru_minflt=42660,
ru_majflt=1, ru_nswap=0, ru_inblock=600, ru_oublock=240, ru_msgsnd=0,
ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=8669, ru_nivcsw=7514)
}}}
With this patch:
{{{
resource.struct_rusage(ru_utime=54.220757, ru_stime=0.35794499999999996,
ru_maxrss=703824, ru_ixrss=0, ru_idrss=0, ru_isrss=0, ru_minflt=187662,
ru_majflt=1, ru_nswap=0, ru_inblock=584, ru_oublock=240, ru_msgsnd=0,
ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=12759, ru_nivcsw=7940)
}}}
This of course is an example that tries to expose exactly the flaw. We're
finding:
- about 10% runtime penalty. That seems to be the garbage collections
that are happening.
- a lot more memory usage (without the patch memory usage is flat. With
the patch you can run out of memory)
I'm not sure how serious this is. It's making me a little hesitant on
whether we should be "fixing" this at all, though!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14159#comment:15>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.