1 | | In #18897 one leak is fixed, but there are more left, see comments 27 and later. |

| 1 | In #18897 one leak is fixed, but there are more left, see comments 27 and later: |

| 2 | {{{ |

| 3 | sage: L = [1,1,0,1,0,1,2,1,1,0,0,1,2,0,0,1,1,0,2,0,0,0,0,0,1] |

| 4 | sage: def test(L, dim): |

| 5 | ....: import gc |

| 6 | ....: from collections import Counter |

| 7 | ....: gc.collect() |

| 8 | ....: pre={id(c) for c in gc.get_objects()} |

| 9 | ....: m = matrix(dim, L) |

| 10 | ....: for p in range(2,102): |

| 11 | ....: m.change_ring(GF(nth_prime(p))).eigenvalues() |

| 12 | ....: gc.collect() |

| 13 | ....: post=Counter(type(o) for o in gc.get_objects() if id(o) not in pre) |

| 14 | ....: return [(k,v) for (k,v) in post.iteritems() if v>10] |

| 15 | ....: |

| 16 | sage: test(L, 5) |

| 17 | [(<class 'sage.rings.algebraic_closure_finite_field.AlgebraicClosureFiniteField_pseudo_conway_with_category'>, |

| 18 | 100), |

| 19 | ... |

| 20 | (<class 'sage.rings.homset.RingHomset_quo_ring_with_category'>, 100), |

| 21 | ... |

| 22 | (<type 'sage.rings.finite_rings.integer_mod.NativeIntStruct'>, 100), |

| 23 | (<type 'sage.rings.finite_rings.integer_mod.Int_to_IntegerMod'>, 200), |

| 24 | ... |

| 25 | (<class 'sage.rings.homset.RingHomset_generic_with_category'>, 100), |

| 26 | ...] |

| 27 | }}} |