in reply to Hunting for a memory leak
If you comment out show_drawing($MW, $ZC); in makeReviewScreen() the leak goes away. So look in show_drawing()
If you comment out the Photo:
my $img = 'fred'; # $MW->Photo( # -data => encode_base64( $small->png ), -format => 'png' # );
The leak goes away.
If you replace the -data option with a -file option and load a small image straight off disk, each iteration leaks by approximately the size of the loaded image.
Conclusion: Tk::Photo doesn't clean up its memory when you undef the Photo object.
I tried adding $img->blank; before the undef, but it made no difference.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hunting for a memory leak
by perldough (Sexton) on Aug 07, 2012 at 17:18 UTC | |
by BrowserUk (Patriarch) on Aug 07, 2012 at 17:30 UTC | |
by perldough (Sexton) on Aug 08, 2012 at 14:10 UTC | |
by BrowserUk (Patriarch) on Aug 08, 2012 at 14:20 UTC | |
by BrowserUk (Patriarch) on Aug 07, 2012 at 18:30 UTC | |
by Anonymous Monk on Aug 08, 2012 at 03:13 UTC | |
by perldough (Sexton) on Aug 08, 2012 at 14:19 UTC | |
by Anonymous Monk on Aug 10, 2012 at 07:44 UTC |