On Oct 24, 8:52 am, Simon King <[EMAIL PROTECTED]> wrote:
> Dear Carlo and all others,
>
> On Oct 23, 5:11 pm, "Carlo Hamalainen" <[EMAIL PROTECTED]>
> wrote:
>
> > Valgrind is the thing to try:http://wiki.sagemath.org/ValgrindingSage
>
> Sorry, when I read the first lines of that page I thought I had to re-
> build Sage from scratch. But later it says that there is an optional
> valgrind package for Sage. I installed it and tried "sage -valgrind".

You need to rebuild Python after exporting SAGE_VALGRIND=yes -
otherwise pymalloc is used and as is the valgrind log is useless in
some regards.

> Then I did
> sage: attach f5.pyx
> Compiling /home/king/Projekte/f5/f5.pyx...
> sage: from sage.rings.ideal import Cyclic
> sage: R=PolynomialRing(QQ,'x',5)
> sage: I=Cyclic(R).homogenize()
> sage: get_memory_usage()
> 1013.09765625
> sage: F=F5()
> sage: G1=F(I)
> sage: del F
> sage: del G1
> sage: get_memory_usage()
> 1035.59765625
> sage: F=F5()
> sage: G1=F(I)
> sage: del F
> sage: del G1
> sage: get_memory_usage()
> 1053.04296875
> sage: quit
>
> However, it didn't help much.
>
> The valgrind output available 
> athttp://sage.math.washington.edu/home/SimonKing/f5/sage-memcheck.18590
> says in the summary that ~386kB are "possibly lost" and nothing is
> "definitely lost".
>
> I think this doesn't fit to the output of get_memory_usage() above.
> Running "F=F5()    G=F(I)" in a loop is soon eating all memory.
>
> Moreover, most of the valgrind output does not refer to my code, as
> much as I understand. Hence, there is only  a handful of references to
> _home_king_Projekte_f5_f5_pyx_0.c
>
> Can you help me with interpreting the valgrind findings?

The key thing here is that the still reachable amount of memory is
growing which indicates a problem with objects from the python heap
not getting properly deallocated, i.e. a potential reference count
issue when using Cython for example. Debugging these is hard and
valgrind will not help much in that case. Much more useful could be
Guppy.

> Thank you very much
>       Simon

Cheers,

Michael
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to