Dear all,

Sorry for the delay getting back to you -- this was waiting in the 
moderation queue for a bit (me being new) and then I dropped the ball.

> run the underlying functions
> 
> M = identity_matrix(n)
> L = M.list()
> MS = sage.matrix.matrix_space.MatrixSpace(GF(101), 1000, 1000, 
sparse=False)
> mat = MS(L, coerce=True, copy=False)
> 
> Maybe repeatedly running the first line causes leakage already?

It appears that the first *two* lines cause the leak, whereas the first 
line by itself does not.  Not sure if that narrows it down, but possibly 
strengthens the 31340 hypothesis below.

> This might be a bug with flint. What flint are you using?

To the best of my knowledge I don't have a system copy of flint, so 
presumably I am using whatever is bundled in sage-9.2/upstream which seems 
to be 2.5.2.

> https://trac.sagemath.org/ticket/31340

I can confirm that the original code on that trac also memory leaks for my 
system (31MB) so it could very plausibly be the same issue.  I have not yet 
read that bug in detail.

Thanks for the feedback.

Best
Freddie
On Wednesday, May 5, 2021 at 1:01:39 AM UTC-7 dim...@gmail.com wrote:

> we've fixed a memory leak in matrices recently (this fix will be in
> 9.3), not sure if this is related
> https://trac.sagemath.org/ticket/31340
>
> On Wed, May 5, 2021 at 8:45 AM 'jonatha...@googlemail.com' via
> sage-devel <sage-...@googlegroups.com> wrote:
> >
> > Dear Freddie,
> >
> > thank you for the report.
> >
> > Fortunatly or unfortunately, I can't reproduce this on sage 9.2 or on 
> the develop branch (on ubuntu focal with libflint-2.5.2 and debian buster 
> with sage's flint 2.6.3).
> >
> > This might be a bug with flint. What flint are you using?
> >
> > You can go into detail, to see, what exactly is causing the problem and 
> instead of
> >
> > _ = identity_matrix(n).change_ring(GF(101))
> >
> > run the underlying functions
> >
> > M = identity_matrix(n)
> > L = M.list()
> > MS = sage.matrix.matrix_space.MatrixSpace(GF(101), 1000, 1000, 
> sparse=False)
> > mat = MS(L, coerce=True, copy=False)
> >
> > Maybe repeatedly running the first line causes leakage already?
> >
> > Jonathan
> >
> > Freddie Manners schrieb am Mittwoch, 5. Mai 2021 um 03:02:04 UTC+2:
> >>
> >> Dear all
> >>
> >> [I attempted to post this a few days ago but seemingly failed, so this 
> is a repost; apologies if duplicate.]
> >>
> >> The following program appears to consume all the memory on my machine:
> >>
> >> n = 1000
> >> for i in range(0, 1000000):
> >> _ = identity_matrix(n).change_ring(GF(101))
> >> print(get_memory_usage())
> >>
> >> I am running Sage 9.2 on a 64-bit gentoo linux box (kernel 
> 5.4.97-gentoo, gcc version 10.2.0).
> >>
> >> I couldn't find any related open bugs. I have worked around the issue 
> (solution: don't create intermediate integer matrices and then coerce them 
> to finite fields; obviously it's less explicit in my original code) but 
> either way this seems to be a new bug.
> >>
> >> Best
> >> Freddie
> >
> > --
> > 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+...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/6fd93c63-3fad-4d20-b624-3d3208d4ec4fn%40googlegroups.com
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/186269e5-da0f-4e09-9610-02be1c2eb556n%40googlegroups.com.

Reply via email to