in reply to Re: Subroutine Memory Leak
in thread Subroutine Memory Leak

I need help in detail..pls let me know how to use it

Replies are listed 'Best First'.
Re^3: Subroutine Memory Leak
by shmem (Chancellor) on Jul 31, 2006 at 06:45 UTC
    The following changes will help:
    my $var = "Subroutine Memory Leak"; $mw->Label( -textvariable => \$var )->pack; sub autorefresh { # $var = $var + 20; $var += 20; return; }

    Don't create a label each time in sub autorefresh. You create a new label each time the sub is executed, but the previous one is still there. You are placing a label over a label over a label over a label...

    --shmem

    update: tested. Memory stays dead on at 7456/5064 VIRT/RES on my system.

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
Re^3: Subroutine Memory Leak
by gopika77 (Initiate) on Jul 31, 2006 at 05:34 UTC
    i checked the code even just giving print to screen without TK the same memory leak