Hi Nils,

On 2012-08-15, Nils Bruin <nbr...@sfu.ca> wrote:
> Continuing ... I think the patches made some difference. Previously, I
> saw a bunch of MatrixSpaces on the heap and they seem to have
> disappeared.

That's good!

> However, there are a whole bunch of IntegerModRings still around.

Like this?

  sage: import gc
  sage: gc.collect()
  662
  sage: p = 1
  sage: for i in range(100):
  ....:     p = next_prime(p)
  ....:     R = ZZ.quotient(p)
  ....:     x = 1+R.one()
  ....:     _ = gc.collect()
  ....:     print len([X for X in gc.get_objects() if isinstance(X,
               
sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic)]),
  ....:     
  2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
  28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
  51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
  74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
  97 98 99 100 101

Note that this only happens if the line "x = 1+R.one()" is present.
Without that line, the number of IntegerModRing_generic in cache remains
constantly 2 (if one has my patches applied, at least...).

In other words: It *is* a memory leak caused by coercion, but it isn't
covered by my patches (yet).

Best regards,
Simon


-- 
-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org



Reply via email to