Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: threads: work crew memory leak

by rakzer (Novice)
on Oct 16, 2010 at 19:23 UTC ( [id://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.

Replies are listed 'Best First'.
Re^3: threads: work crew memory leak
by BrowserUk (Patriarch) 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.
      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.
      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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-03-19 04:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found