Dr. Mu has asked for the wisdom of the Perl Monks concerning the following question:
The code works as I want it to, but I can watch the program's memory allocation climb as it runs. I've isolated the apparent memory leak to thesub CheckIDE { my $vis = $ide->get_property('foreground') == $ide ? 1 : 0; my $coord = $ide->get_property('rect'); exit unless defined $coord; if ($vis > $curvis) { $mw->deiconify; $mw->raise } elsif ($vis < $curvis) { $mw->withdraw } $curvis = $vis; my ($rgt, $top) = map {$coord->{$_}} qw/right top/; $rgt += $dx; $top += $dy; $mw->geometry("+$rgt+$top"); $check = $mw->after(10, \&CheckIDE) }
statement. It would appear that the hash referenced by $coord is never returned to the heap when this subroutine returns.my $coord = $ide->get_property('rect')
Does this analysis sound right? What can I do prevent the ever-increasing memory footprint?
Thanks,
-Phil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Memory leak in Win32::CtrlGUI?
by Anonymous Monk on Apr 12, 2011 at 06:40 UTC | |
by Dr. Mu (Hermit) on Apr 12, 2011 at 16:11 UTC | |
by Anonymous Monk on Apr 12, 2011 at 16:40 UTC | |
by Dr. Mu (Hermit) on Apr 15, 2011 at 05:03 UTC | |
|
Re: Memory leak in Win32::CtrlGUI? [SOLVED, sort of]
by Dr. Mu (Hermit) on Apr 15, 2011 at 05:07 UTC | |
|
Re: Memory leak in Win32::CtrlGUI?
by InfiniteSilence (Curate) on Apr 12, 2011 at 14:30 UTC | |
by Dr. Mu (Hermit) on Apr 12, 2011 at 15:43 UTC | |
|
Re: Memory leak in Win32::CtrlGUI?
by Dr. Mu (Hermit) on Apr 12, 2011 at 18:29 UTC |