Don't ask to ask, just ask | |
PerlMonks |
Re^3: Thread creation failed: pthread_create returned 11 (Either join or detach)by BrowserUk (Patriarch) |
on Aug 11, 2015 at 18:30 UTC ( [id://1138217]=note: print w/replies, xml ) | Need Help?? |
You are simply exhausting your memory because you are never joining your threads. The easiest fix is to just detach your threads so they get cleaned up automatically. (Also, there is no point in calling threads->exit; better to just fall off the end. So whilst your example above chews up 8GB of memory in around a minute or so, this slightly modified version runs with no signs of memory growth at all:
There are several other bad things and weirdnesses in that short snippet -- most of which would be cured by making it strict/warnings safe; but I guess that request fell on deaf ears -- but it will cure your headline problem. 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". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
In Section
Seekers of Perl Wisdom
|
|