in reply to Re^2: Perl threads memory leak with socket and solutions I tried...
in thread Perl threads memory leak with socket and solutions I tried...

I modified it a little.

In a way that causes memory leaks?


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.
"I'd rather go naked than blow up my ass"
  • Comment on Re^3: Perl threads memory leak with socket and solutions I tried...

Replies are listed 'Best First'.
Re^4: Perl threads memory leak with socket and solutions I tried...
by ilxl (Initiate) on Feb 10, 2010 at 02:47 UTC
    I don't think so. Per what I tried, memory leak has nothing to do with socket, but to do with threads.
      memory leak has nothing to do with socket, but to do with threads.

      That's a bold assertion. And if you're happy that you're correct. Dump threads and use something else.

      But, on recent builds, threads don't leak on their own.

      Run this on 5.10.1 and you'll see the memory usage wobble up and down a bit (around ~5.5MB on my system), as new threads are created and old ones are destroyed. But in few minutes it creates and destroys 100,000+ threads and the memory use is essentially static:

      perl -Mthreads -E"{ async{ print qq[\r], threads->tid; }->detach; sele +ct'','','',0.001; redo}"

      What often does cause leaks is the way people use threads.

      And if you want some help, you're going to have to show me what you are doing in your code. Ie. Show me the code so that I can run it.


      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.