Memory leak in is_planar

asked 2024-07-26 11:05:57 +0100

Gordon gravatar image

updated 2024-07-26 12:17:59 +0100

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.

edit retag flag offensive close merge delete

Comments

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.

vdelecroix gravatar imagevdelecroix ( 2024-07-26 20:46:11 +0100 )edit

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.

vdelecroix gravatar imagevdelecroix ( 2024-07-26 20:47:34 +0100 )edit
1
David Coudert gravatar imageDavid Coudert ( 2024-07-27 10:57:44 +0100 )edit