0

In my java batch application (Jboss ,OS -Linux) facing error- Java.lang.OutOfMemoryError: unable to create new native thread. while launching new JVM instance

Below are the related server and OS level setting. ulimit - u = 4096, ulimit -a = 4096 Java Heap setting - Xms3g -Xmx32 g (total physical memory 64g). JVM stack size - 1024mb PermGen space - 512 mb

Whenever we face this issue, We checking thread (process) count on linux server, and its always less than 1000. Java heap memory is also under controlled.

Most of the time server(jobss)restart fix the issue temporally .

4
  • Rule of thumb per thread I think is 1mb of stack, so you're hitting exactly that with your stack size limit. Commented May 26, 2016 at 19:21
  • @ThomasJungblut - I will reduce the stack size and test it again, but I seen 15 gb free memory (by using top command ) on the system the time when it failed. Commented May 27, 2016 at 7:05
  • you need to increase the stack size limit, not reduce it. Commented May 27, 2016 at 7:27
  • @ThomasJungblut - Linux stack size is (kbytes, -s) 10240. Above mentioned is JVM thread stack size (per thread) is 1024 kB (corrected). Most of blog is suggesting to reduce the JVM thread size - link Commented May 27, 2016 at 9:23

1 Answer 1

0

Are you using 64-bit JVM ? If yes, then there should not be an issue of memory. If you are using 32-bit JVM then you should think for memory issues like reducing heap, reducing stack size, etc.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.