# Revision history [back]

I can not reproduce you problem, you should provide more details, see:

sage: I = random_matrix(ZZ,10,10)
sage: M = Matroid(matrix = I, ring = GF(2))
sage: for _ in range(10):
....:     for i in range(0, M.corank() + 1):
....:         for F in M.coflats(i):
....:             pass
....:     get_memory_usage()
....:
8393.46875
8393.71875
8393.71875
8393.71875
8393.71875
8393.71875
8393.71875
8393.71875
8393.71875
8393.71875


I can not reproduce you problem, you should provide more details, see:

sage: I = random_matrix(ZZ,10,10)
sage: M = Matroid(matrix = I, ring = GF(2))
sage: for _ in range(10):
....:     for i in range(0, M.corank() + 1):
....:         for F in M.coflats(i):
....:             pass
....:     get_memory_usage()
....:
8393.46875
8393.71875
8393.71875
8393.71875
8393.71875
8393.71875
8393.71875
8393.71875
8393.71875
8393.71875


EDIT There is indeed a memory leak in the components method of BasisExchangeMatroid, a call to sig_free was missing. This is now trac ticket 28498, thanks for reporting.

So, you can wait for a next release that the fix is incorporated into Sage, or if you built Sage from Source, you can just add the missing line and recompile.