Opened 9 months ago

Closed 9 months ago

#26806 closed defect (fixed)

Memory leak _is_relaxation()

Reported by: jmantysalo Owned by:
Priority: major Milestone: sage-8.5
Component: memleak Keywords:
Cc: Merged in:
Authors: Dima Pasechnik Reviewers: Jori Mäntysalo
Report Upstream: N/A Work issues:
Branch: a2ff305 (Commits) Commit: a2ff305c78732611c651b5fb83233995fd712156
Dependencies: Stopgaps:

Description (last modified by dimpase)

src/sage/matroids/basis_matroid.pyx has _is_relaxation() with bitset_init for bb_comp and b2, but no corresponding bitset_free. Try this:

from sage.matroids.advanced import *
import gc

i = 0
while True:
    if i%5000==0:
        gc.collect() 
        print get_memory_usage()
    i += 1
    M = BasisMatroid(matroids.named_matroids.NonFano())
    N = BasisMatroid(matroids.named_matroids.Fano())
    m = {e:e for e in M.groundset()}
    tm=M._is_relaxation(N, m)
    tn=N._is_relaxation(M, m)

Change History (6)

comment:1 Changed 9 months ago by dimpase

  • Description modified (diff)

comment:2 Changed 9 months ago by dimpase

  • Branch set to u/dimpase/matroids/memleaks
  • Commit set to a2ff305c78732611c651b5fb83233995fd712156

this was easy

comment:3 Changed 9 months ago by jmantysalo

  • Reviewers set to Jori Mäntysalo

Thanks. Please fill author name and put to needs_review.

If this was too easy, see psi(0.5) at #19363...

comment:4 Changed 9 months ago by dimpase

  • Authors set to Dima Pasechnik
  • Status changed from new to needs_review

comment:5 Changed 9 months ago by jmantysalo

  • Status changed from needs_review to positive_review

Thanks.

comment:6 Changed 9 months ago by vbraun

  • Branch changed from u/dimpase/matroids/memleaks to a2ff305c78732611c651b5fb83233995fd712156
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.