I just made some testing. For example this shows small memory leak:

i = 0
for P in Posets(7):
    if i%1000 == 0:
        print i, get_memory_usage()
    i += 1

Or does it? At least when I run same code again, it will eat still more memory. Then, after

P7=Posets(7).list()

for example

i = 0
for P in P7:
    if i%1000 == 0:
        print i, get_memory_usage()
    M = P.is_connected()
    i += 1

seems to have no leak, whereas

i = 0
for P in P7:
    if i%1000 == 0:
        print i, get_memory_usage()
    M = P.mobius_function_matrix()
    i += 1

increases memory use, but only for first time. Same happens with

i = 0
for P in P7:
    if i%1000 == 0:
        print i, get_memory_usage()
    M = P.mobius_function(0,1)
    i += 1

Or if I run

i = 0
for P in P7:
    if i%1000 == 0:
        print i, get_memory_usage()
    M = P.width()
    i += 1

for many times, it seems to eat some memory in some rounds.

Is some of these a real memory leak, or just some side effect of delayed garbage collection?

--
Jori Mäntysalo

Reply via email to