On Tue, Feb 12, 2019 at 1:58 PM Simon King <simon.k...@uni-jena.de> wrote: > > Hi Nadim, > > On 2019-02-12, Nadim Rustom <restom.na...@gmail.com> wrote: > > The following shows a small memory leak: > > R.<X,Y> = ZZ[] > > > > > > P = (X+Y)^120*Y^100 > > > > > > mem1 = get_memory_usage() > > for i in range(100): > > Q = P(X,Y) > > mem2 = get_memory_usage() > > > > > > print mem2 - mem1 > > > > > > whereas the following gives a much bigger memory leak: > > > > R.<X,Y> = ZZ[] > > > > > > P = (X+Y)^120*Y^100 > > > > > > mem1 = get_memory_usage() > > for i in range(100): > > Q = P(X,Y) > > mem2 = get_memory_usage() > > The two examples are identical. Copy-and-paste error? > > In any case, I can confirm that it leaks (and I am surprised that it > does), even if python's cyclic garbage collection is invoked explicitly. > > > Additionally, I noticed that operations with multivariate polynomials are > > way faster on Sage 7.4 than on Sage 8.*. Is there any work around for this > > problem? I tried to search in the open tickets, the closest thing I could > > find is this: > > > > https://trac.sagemath.org/ticket/13447 > > > > Could this be what is causing these issues? > > Certainly not, since #13447 is not merged yet. > > Leaks could be in at least two places here: > (1) An unsolicited reference chain that prevents a Sage polynomial > from being garbage collected. > (2) The underlying libsingular polynomial object is not freed when the > Sage polynomial becomes collected. > > #13447 tries to sanitize the refcounting of libsingular objects. So, > if anything, #13477 could have the potential to fix that memory leak. > And in addition, the examples given on the ticket show that it results > in a speed-up for creation and deletion of polynomials. > > Before opening a new ticket for this issue, I'd like to test if #13477 > helps with this issue.
it fixes the leak in the 1st example, but not in the 2nd, according to my test. > > Best regards, > Simon > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.