This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Am trying to spawn a new thread for every client that is connecting to my application. At present am not able to spawn more than 1085 threads, beyond which am getting the below exception. I am using HP UX 11.31 64 bit machine
Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
Would greatly appreciate any insights to overcome this problem.
yes, apart from increasing the -Xmx i've tried giving a lower value for it as well to make more memory available for native kernel.
i just said clients to indicate that its not a bad design and i cannot do away with the thousand threads running. I use TCP and hence i manage the socket output stream in a thread for each client connection. So nothing to do with RMI here.
The issue is more related to the HP UX 11.3 machine, as the same program runs fine in other OS such as AIX.
Joined: Nov 02, 2009
the problem got resolved soon after running the program in 64 bit mode.