Discussion:
Memory leak in Polyhedron objects
(too old to reply)
jplab
2014-06-16 14:47:18 UTC
Permalink
Hey Sage-devel!

I've been experiencing memory issues dealing with Polyhedron objects for a
while now... Perhaps it is time to look if something could be done.

Here is a simple code reproducing the (what I believe to be a) memory leak.

First, I use the garbage collector to force the cleaning of memory and then
look if the python command grows in memory in a "top".

sage: while True:
P=Polyhedron(vertices=[[1,0,0],[0,1,0],[0,0,1]])
eq=P.equations()
del P, eq
gc.collect()
....:
63
31
31
31
31
...

It constantly collects garbage, which is to be expected, and on the long
run, the python command does not increase in memory usage. While, on the
contrary:

sage: while True:
....: P=Polyhedron(vertices=[[1,0,0],[0,1,0],[0,0,1]])
....: fv=P.f_vector()
....: del P, fv
....: gc.collect()
....:
0
0
0
...

Which not to be expected I guess. Then, when one waits enough, one sees in
the "top" that the memory of python increases steadily... This is bad!

I have observed the same behavior with the following functions:

adjacency_matrix
f_vector
face_lattice
facet_adjacency_matrix
facial_adjacencies
graph
is_simple
vertex_adjacencies (although deprecated, also in the new method to produce
the output)
vertex_adjacency_matrix
vertex_graph

Someone has an idea?
--
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 post to this group, send email to sage-***@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
Volker Braun
2014-06-16 14:53:45 UTC
Permalink
The problem is in posets, so you get it in all methods that construct the
face lattice:

http://trac.sagemath.org/ticket/14356
Post by jplab
Hey Sage-devel!
I've been experiencing memory issues dealing with Polyhedron objects for a
while now... Perhaps it is time to look if something could be done.
Here is a simple code reproducing the (what I believe to be a) memory leak.
First, I use the garbage collector to force the cleaning of memory and
then look if the python command grows in memory in a "top".
P=Polyhedron(vertices=[[1,0,0],[0,1,0],[0,0,1]])
eq=P.equations()
del P, eq
gc.collect()
63
31
31
31
31
...
It constantly collects garbage, which is to be expected, and on the long
run, the python command does not increase in memory usage. While, on the
....: P=Polyhedron(vertices=[[1,0,0],[0,1,0],[0,0,1]])
....: fv=P.f_vector()
....: del P, fv
....: gc.collect()
0
0
0
...
Which not to be expected I guess. Then, when one waits enough, one sees in
the "top" that the memory of python increases steadily... This is bad!
adjacency_matrix
f_vector
face_lattice
facet_adjacency_matrix
facial_adjacencies
graph
is_simple
vertex_adjacencies (although deprecated, also in the new method to produce
the output)
vertex_adjacency_matrix
vertex_graph
Someone has an idea?
--
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 post to this group, send email to sage-***@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
jplab
2014-06-16 15:07:40 UTC
Permalink
Post by Volker Braun
The problem is in posets, so you get it in all methods that construct the
http://trac.sagemath.org/ticket/14356
Ok! Good to know! Thanks for the quick reply!
--
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 post to this group, send email to sage-***@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
Loading...