On Oct 23, 7:57 am, Simon King <[EMAIL PROTECTED]> wrote:
> Dear Sage team,
>
> I have two cdef'd classes (lets call them A and B). They have some
> cdef'd attributes that should be harmless, namely of type int or list
> or dict. The entries of these lists/dicts may be objects of class A
> though.
>
> Let me emphasize that A and B do not rely on any external (wrapped) C-
> Types. They are entirely built from int, list, dict, object. In
> particular, I am not doing any nasty memory allocation.
>
> I understood that Cython knows how to allocate and deallocate cdef'd
> attributes of type int, list, dict, object etc. Hence, I expected that
> I do not need to provide __del__ or __dealloc__ methods for A and B.
> And I expected that it is virtually impossible to produce a memory
> leak in such setting.

Famous last words.

> Nevertheless, get_memory_usage() shows that
>    creating an object of class B,
>    doing a computation "Result = B(...)", and
>    deleting B
> results in an increased memory usage of 2.57MB per run.

Do you also delete "Result"

> What tools do you recommend to tracking that memory leak down?
>
> Yours
>        Simon

Depending on the situation it can either be guppy or valgrind. I can't
say anything without seeing the code, but I don't really have time to
take a closer look for the next couple days anyway.

Cheers,

Michael
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
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