>>OutOfMemoryError: unable to create new native thread
" The default stack size for Java 1.4x 64-bit mode JVM- created threads is 1MB."
Try reducing this by using the -Xss switch you will be able to generate more Threads , yes the application threads .
I think you are getting this error when there is a heavy load , is that correct .
Also check this
Thanks for the quick answer.
The server is not under heavy load, we have seen this problem just after startup when no more than 2 or 3 users are active.
Admittedly 2 users are using a EJB3-heavy (i.e. lots of bean cross references, fetch joins etc) page simultaenously.
We have had problems with JVM options before, mainly because we use JasperReports which eats alot of PERM space. But in this particular case JasperReports has not been active.
My current thinking is to disable the connection checker and use connection-sql strings instead and see what happens.
Please follow up on this and let us know if you are still having issues. If so, I need to find the cause. The OracleValidConnectionChecker could stand some reworking as it is.
One thing that does not help is that server.log gets wiped out (i.e emptied or overwritten) when this error happens and JBoss restarts. All I have to work on is the console output.
To keep the server.log set the "append" property to true in your Log4J appender. See conf/log4.xml.
On 32 bit architecture the JBoss process can allocate at max. 2GB of memory. You gave it 1GB of heap. Plus some PermGen. The rest is available to stack space. Every thread allocates its own stack. This may be 256kb to 1MB depending on your platform (see you JVM documentation). It's a simple calculation how many threads you can spawn like so.
1. Reduce the number of threads: reduce MDB / EJB pools, reduce number of EJBs/MDBs/timers.
2. Reduce your heap (-Xmx parameter) to make more memory available to the stack
3. As a last resort reduce your stack size (-Xss parameter)
Use jconsole to see how much memory you really need in heap and permGen.
I have had problems with this particular Web-App page before. It used to cause 'CompilerThread' errors in the JVM (causing the JVM to exit) before I rearranged the EJB loading order. I cannot find my original bulletin board post about the CompilerThread issue (do JBoss purge old posts?).
My feeling is that we are pushing EJB/Java/??? too hard. It does not set a good impression when this is our first sizeable EJB project, and I cannot say that it is particularly complex.
P.S. Server spec:
Windows 2000 (5GB RAM, 4 CPU)
JBoss 4.0.4.GA - EJB3 configuration installed