0

We have a java application hosted on two different Application Servers with 64GB RAM and 32vCPU each. And HaProxy as a Loadbalancer in front.

With this setup in our VPS servers, we cannot reach 100 concurrent users. The application keeps throwing the below error message even if we have enough free memory(Approximately 40GB RAM).

ERROR org.springframework.boot.context.web.ErrorPageFilter - Forwarding to error page from request [/create-new] due to exception [unable to create new native thread]
java.lang.OutOfMemoryError: unable to create new native thread
    at java.lang.Thread.start0(Native Method) [na:1.8.0_262]
at java.lang.Thread.start(Thread.java:717) [na:1.8.0_262]
at org.codehaus.groovy.runtime.DefaultGroovyStaticMethods.createThread(DefaultGroovyStaticMethods.java:104) ~[groovy-2.4.5.jar:2.4.5]
at org.codehaus.groovy.runtime.DefaultGroovyStaticMethods.start(DefaultGroovyStaticMethods.java:58) ~[groovy-2.4.5.jar:2.4.5]
at sun.reflect.GeneratedMethodAccessor2752.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_262]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_262]
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:54) ~[groovy-2.4.5.jar:2.4.5]
at org.codehaus.groovy.runtime.metaclass.NewStaticMetaMethod.invoke(NewStaticMetaMethod.java:53) ~[groovy-2.4.5.jar:2.4.5]
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:151) ~[groovy-2.4.5.jar:2.4.5]

RAM

App1 # free -m
                              total        used        free      shared  buff/cache   available
                Mem:          65536        21480        44056           2        10341       33715
                Swap:             0           0           0

However, on AWS with the same configuration and setup, the app can handle more than 200 concurrent users.

We are hopeless, any suggestions will be greatly appreciated!

3
  • please take a look at OS settings how many native threads can be spawned. Check also stackoverflow.com/questions/8203156/… Commented Jul 15, 2020 at 12:41
  • 1
    The machine has run out of available memory and cannot create anymore threads. You're going to have to provide some type of in-depth analysis. Commented Jul 15, 2020 at 12:42
  • Sounds like you are NOT passing any -Xmx flag thus JVM is running with default values. So even if your server has lots of memory, JVM is unable to use it. Try setting Xmx and default Xmx to further understand Xmx and use appropriate value for Xmx. Try setting it to -Xmx40GB , if the application still throws OutOfMemory, you likely have a memory leak in your application. Commented Jul 15, 2020 at 15:16

0

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.