Ask Your Question
2

Problems with memory usage with bliss algorithm

asked 2023-08-18 04:24:53 +0100

Gordon gravatar image

I am trying to run a very long (weeks long) process that constructs a large collection of graphs.

The collection is too large to keep in memory and so as each graph is found it is stored on disk (rather than in an array).

However when I set it running, I noticed that the amount of RAM used by the process was continuously increasing until the rest of the machine ground to a halt. My computer has 64Gb RAM and it takes a bit more than a day for the process to grow to that size.

I have tried to isolate the part of the program that was causing the memory usage to grow, and I think that I have isolated it to the canonical labelling algorithm "bliss".

Here is a simple program that just creates random graphs and canonically labels them (but does nothing more):

for it in range(1000000):
    g = graphs.RandomGNP(20,0.5)
    gc = g.canonical_label(algorithm="bliss")
    if it % 1000 == 0:
            print(it)

When I run this program the memory consumed grows and grows.

If I change the program to use the built-in Sage method,

for it in range(1000000):
    g = graphs.RandomGNP(20,0.5)
    gc = g.canonical_label(algorithm="sage")
    if it % 1000 == 0:
            print(it)

then the program runs to completion with no increase in memory used - the memory is correctly being recovered as it goes out of scope each time through the loop.

What should I do in this situation?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2023-08-18 08:48:01 +0100

rburing gravatar image

updated 2023-08-18 08:55:30 +0100

Which version of SageMath are you using? I remember investigating this over a year ago and the issue #33010 should be fixed by #35344 which is in 10.1.beta5 and later.

Please try the latest pre-release (10.1.rc0 at the time of writing) and check that the issue is fixed.

edit flag offensive delete link more

Comments

1

I use the most recent MacOs X binary version as provided at https://github.com/3-manifolds/Sage_m... which, by Murphy's Law is 10.0. They also supply a pre-release version, currently 10.1, so I will try that and see what happens.

Gordon gravatar imageGordon ( 2023-08-18 09:09:46 +0100 )edit
1

Excellent - 10.1 does not display the memory leak for bliss, so I'll restart the program and see if it can catch up with the running version using the Sage algorithm. Thanks.

Gordon gravatar imageGordon ( 2023-08-19 05:04:44 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-08-18 04:24:53 +0100

Seen: 228 times

Last updated: Aug 18 '23