in reply to Multiple threads for many connections - memory problem

You could try using use threads ( stack_size => 4096 );. On my system that means that 500 simple threads consume 177 MB, or around 350k per thread.

If that is still too much, then a IO::Select solution will definitely consume less memory, and probably wouldn't be much more complex for an application as simple as this.


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.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."