I\'ve been reading and testing and banging my head on the wall for over a day because of this error.
I have some Java code in a class called Listener t
It's not missing memory for your new threads, it's missing actual threads. The system is probably stopping you: there's a limit to the number of thread a user can create. You can query it that way:
cat /proc/sys/kernel/threads-max
Note that you might be impacted by other processes on the same machine, you they create many thread too. You might find this question useful: Maximum number of threads per process in Linux?