Memory leak in is_planar
I have been working with planar graphs using SageMath 10.3 in a Jupyter notebook on an M3 MacBook Pro.
My kernel kept crashing and restarting and when I searched for the reason, I discovered that the process was consuming all the RAM on my machine and eventually being killed.
I used command line top -o mem
to watch the process consuming more and more memory until it was killed.
Here is a MWE illustrating the problem.
count = 0
for g in graphs.nauty_geng('-C 10'):
if g.is_planar():
count = count+1
print(count)
I have also tested this on the SageMath command line interface just in case it was some complication with Jupyter.
I first verified that the nauty_geng
process was not consuming memory and then added various commands is_antipodal
, is_hamiltonian
etc just to be sure that it was only is_planar
that was at fault.
What should I do (a) in the short term to work around it, and (b) in the long term to report the bug and get it fixed?
EDIT I reinstalled SageMath10.2 and the memory leak persisted, but when I reinstalled SageMath10.1 it no longer manifested. So I guess that I have answered my own short-term solution.
I confirm the behavior in sage 10.4: the provided code eats the memory while removing the call to
g.is_planar()
presents no such problem.To report the bug, your post here is enough. Thanks. If you have a github account, you can go one step further an open an issue at https://github.com/sagemath/sage/issues, but any regular developer could do it.
I pushed a fix in https://github.com/sagemath/sage/pull...