Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Hunting for a memory leak

by perldough (Sexton)
on Aug 07, 2012 at 17:18 UTC ( #986035=note: print w/ replies, xml ) Need Help??


in reply to Re: Hunting for a memory leak
in thread Hunting for a memory leak

Thank you for this. I believe I need to start doubting the CPAN modules a little more. With your diagnosis, I went to CPAN and found that the bug is already documented.

However, contrary to your diagnosis, the documentation says that use of the -file option does not cause this behaviour. Maybe there is something here I can use...

Thanks again,
Perldough


Comment on Re^2: Hunting for a memory leak
Re^3: Hunting for a memory leak
by BrowserUk (Pope) on Aug 07, 2012 at 17:30 UTC
    contrary to your diagnosis, the documentation says that use of the -file option does not cause this behaviour.

    Hm. Here are my findings using the -file option:

    [18:25:56.31] C:\test>dir test.png 26/05/2012 11:30 7,133 test.png [18:26:17.25] C:\test>986015.pl start perl.exe 6476 Console 1 29 +,328 K end start perl.exe 6476 Console 1 34 +,652 K end start perl.exe 6476 Console 1 38 +,348 K end start perl.exe 6476 Console 1 38 +,180 K end start perl.exe 6476 Console 1 39 +,324 K end start perl.exe 6476 Console 1 42 +,816 K end start perl.exe 6476 Console 1 45 +,948 K end

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      I didn't mean to challenge your finding; rather, I meant to imply that I could maybe look for a way of coaxing my code into exhibiting the behaviour posted in the bug report in order to eliminate the leak.

      I any case, thanks for taking the time for confirming this.

      Perldough

        It is quite possible that I am using a down-level tk/tk::photo relative to the guy who reported the bug.

        I only posted my findings to warn you that you should check your installation before assuming the fix.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?

Re^3: Hunting for a memory leak
by BrowserUk (Pope) on Aug 07, 2012 at 18:30 UTC

    Looking in the POD for Tk::Image it says:

    CAVEATS It's necessary to use the "delete" method to delete an image object and free memory associated with it. Just using a lexical variable for storing the image object and letting the variable to go out of scope or setting to undef is not sufficient.

    That said, I tried adding

    $ZC->centerTags($dwg); $img->delete; undef $img;

    And it made no difference.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

Re^3: Hunting for a memory leak
by Anonymous Monk on Aug 08, 2012 at 03:13 UTC

    Thank you for this. I believe I need to start doubting the CPAN modules a little more.

    Tk modules are notorious for leaks -- also , if the module builds any kind of tree, and grepping the source for "weak" returns no hits, 97/100 its leaking :)

      That's interesting. Would you mind explaining why that is?

      Perldough

        That's interesting. Would you mind explaining why that is?

        Because that is just the way it is :) Trees means circular references (memory leak unless you take some steps), and Tk encourages both circular references and closures -- just look in the bug cue for any Tk- distribution, you'll see lot of reports of leaks

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://986035]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2014-10-01 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (31 votes), past polls