Nils Bruin wrote:
On Sunday, May 25, 2014 5:15:08 AM UTC-7, Simon King wrote:

    So, it is a tiny amount of memory (~25 byte per round), but I guess it
    should be fixed anyway.


I see a little more memory (~42 bytes). From such a small amount you can
already guess no python objects get leaked, and indeed gc.get_objects()
doesn't report anything unusual.

I'm counting 40 bytes (= 5 64-bit objects) per loop for the given example, presumably the size of the spolyrec struct returned (i.e., allocated and filled) by

singular_polynomial_call(&res, self._poly, _ring, coerced_x, MPolynomial_libsingular_get_element)

We have

struct  spolyrec
{
  poly      next;           // next needs to be the first field
number coef; // and coef the second --- do not change this !!!
  unsigned long exp[VARS];  // make sure that exp is aligned
};

where both 'next' and 'coef' are pointers, and VARS is usually zero, so 'exp' is an "open-ended" array, such that the effective size of the struct varies.


I did try changing to a=f(1,1,0), [in that case a=0] and then no leak
occurs! So my guess is a leak in libsingular (or our interface with/use
of it), and it's only leaking on construction of non-zero values.

Yes, the leak depends on the values (and the amount also on the field and the function). My impression is also that it appears whenever res!=NULL, i.e., the result is non-zero.

The (Sage-)Singular experts will know better to whom it's up to free what and when...


Probably time to brush up your valgrind skills ...

:-)


-leif

--
() The ASCII Ribbon Campaign
/\   Help Cure HTML E-Mail

--
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.

Reply via email to