2015-01-28 8:00 UTC+01:00, Simon King <simon.k...@uni-jena.de>: > Hi Nils, > > On 2015-01-27, Nils Bruin <nbr...@sfu.ca> wrote: >> It suggests there is a homset that gets created and forgotten every time. >> >> You should probably dig into the callgraph to see who is triggering this >> call. It suggests to me that between 5.12 and 6.4, some memory leak in Hom >> >> caching was resolved. In your particular case it suggests that you may now >> >> have to do some extra work to keep the relevant homset alive (or some >> other >> object that needs it). > > Yes, that sounds reasonable. We did a *lot* of effort to make it > possible that homsets can be forgotten, to prevent memory leaks. > Now, it should be the case that you need a strong reference to both > domain and codomain to keep the homset alive (or a strong reference to > the homset itself, of course). And concerning strong reference to > (co-)domain: Many constructors are cached, but that is a *weak* cache.
This is really annoying from the user perspective (and it might also be related to the infinitely longer TestSuite(M) that I mentioned above). Do you have an idea for a mechanism that would make this automatic ? I mean while doing sage: P = ProductRing((GF(5), GF(5))) I would like that all important coercions to be kept alive until P dies. It might be something explicit in the constructor of ProductRing. Would the following of good practice within Sage: class ProductRing(Parent): def __init__(self, ...): ... self._cache = [self.coerce_map_from(GF(5))] Thanks. Vincent -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.