Re: memory leaks with Tk::Canvas
Christophe Mertz <[email protected]>
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Organization | IntuiLab |
| Message-ID | <1107177906.13822.60.camel@datura> |
Hello, I clearly missed many mails on the mailing list... As I was interested in the repliys to my question, I found the answer of znetara on google: http://groups.google.fr/groups?hl=fr&lr=&group=comp.lang.perl.tk This is my reaction. Sat 29/01/2005, Zentara wrote : > Friday 28/01/2005, Christophe Mertz wrote: > >Hello, > > > we have some memory leaks in one of our (relatively big) interactive > > application based on perl/Tk (and zinc!). After some inquiry we finally > > detects some leaks in Tk::Canvas > > > > In the attached simple script I reproduce apparently two different > > leaks: > > > > 1) when clicking repeatedly on the blue button (ie without waiting the > > end of the "animation"), it seems there is a leak or 132kB (linux ptk > > 804.027) or 4kb (win activestate 804.027) > On my 804.027 linux, it starts out at 8452kb. > If I slowly repeadedly click on the blue rect, it increases in mem to > 8592kb, but levels out there. I can easily go beyond 500kB memory leak (for example: 80 repeated clicks, than waiting until all staled animations are finished, then clicking apparently more than 80 times... etc...) However, it seems you are right: the allocated memory seems to be re-used > > If I quickly repeatedly click the blue rect, it increases on each click, > but runs without increasing after the clicking stops, and only seems to > go above the 8592kb value due to "fast clicking". I just test it again and my results (linux ptk 804.027) seems differents than yours, Zentara: - when I click on the blue rectangle after the end of each animation, I have NO memory consomption (tested for 50 clicks!) - when I click about twelve to twenty times in a short time (about 1-2s), I have this 128kB (or 132kB) memory consomption A also discovered than if clicked about a hundred times quickly on the blue rectangle, I got the following message: Deep recursion on anonymous subroutine at canvas.pl line 37. Deep recursion on subroutine "main::anim1" at canvas.pl line 20. It seems that perl/tk allows only 100 "recursive" callbacks, which is not really a pb in normal use, I guess. Any ideas? -- Christophe Mertz -++**==--++**==--++**==--++**==--++**==--++**==--++**== This message was posted through the Stanford campus mailing list server. If you wish to unsubscribe from this mailing list, send the message body of "unsubscribe ptk" to [email protected]