Dear Simon,

Thank you for your reply. Indeed I copied the example twice... The second 
one just has "Q = P(X+Y,Y)" instead of "Q = P(X,Y)". Or even "Q = P(X+Y, 
X-Y)" results in a larger leak.

Just to clarify, I didn't mean to ask whether #13447 itself is causing the 
problem, I was just wondering if these problems were known and whether 
#13447 was meant to fix the memory leak and speed problem. Thanks for your 
efforts.

Best,
Nadim.

tirsdag den 12. februar 2019 kl. 16.58.09 UTC+3 skrev Simon King:
>
> Hi Nadim, 
>
> On 2019-02-12, Nadim Rustom <restom...@gmail.com <javascript:>> 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. 
>
> 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.

Reply via email to