Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: threads: work crew memory leak

by rakzer (Novice)
on Oct 16, 2010 at 19:23 UTC ( #865714=note: print w/ replies, xml ) Need Help??


in reply to Re: threads: work crew memory leak
in thread threads: work crew memory leak

I am using perl v5.12.2, threads v1.75, threads::shared v1.32.

My shenanigans with the semaphores and the detaching was a desperate attempt to plug the memory leak but of course you're right, it was useless. As others replied this could be an underlying problem with pthread. For now I'll rewrite the code to reuse threads.


Comment on Re^2: threads: work crew memory leak
Re^3: threads: work crew memory leak
by BrowserUk (Pope) on Oct 16, 2010 at 20:03 UTC
    I am using perl v5.12.2, threads v1.75, threads::shared v1.32.

    It might be worth your while trying threads v1.81 & threads::shared v1.34.

    As others replied this could be an underlying problem with pthread.

    *nix/pthreads isn't something I know much about, but my gut feel is this is more likely to be a problem with (perl) memory allocation than the underlying threading libraries.

    One thing that should be done, if this is going to get fixed, is to find a minimal test case that demonstrates the problem and a bug report raised. Something like:

    perl -Mthreads -wE"{sleep 1 while threads->list>20;async(sub{1})->deta +ch;redo}"

    Assuming that actually leaks on your system, because the memory usage is rock solid at 12.5MB here.

    For now I'll rewrite the code to reuse threads.

    Once you do, you'll never go back to using throw-away threads.


    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.
      After 20 minutes the process used 2.3GB of memory. I will repeat the same test as soon as I have the proposed threads/threads::shared version available. Thank you very much for your help.
      One thing that should be done, if this is going to get fixed, is to find a minimal test case that demonstrates the problem and a bug report raised.

      It's already there, no need to clog RT with identical reports. #69598

        Cool++ Thanks for the heads up.


        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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2014-12-18 11:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (50 votes), past polls