Profile Image
edouard

jboss terminating due to OutOfMemory: Java heap space

Hello,

I have multiple crash of jvm for one application.

Actually, 18 crash since 04/02.

Before 04/02 we have a profile of jvm with 2GB RAM with error in log jboss: "Terminating due to java.lang.OutOfMemoryError: Java heap space".

For example we have 19 crash 26/01.

Therefore we have upgrade memory to 4GB since 04/02 and now we haven't error OutOfMemoryError in our logs but we have sometime always crash of jvm.

I tried to analyze GC logs just before the crash with the shared report, but the only one that I can see is that the garbage does not seem to be doing its job because just before the crash we see that the young and old generation are not cleaned. Can you help me in the analyze ?



Report URL - https://gceasy.io/my-gc-report.jsp?p=c2hhcmVkLzIwMjEvMDIvMjMvLS1iYWNrdXBnYy5sb2cuY3VycmVudC0tNy00NS00Mg==&channel=WEB

  • jvm

  • javaheapspace

  • younggen

  • oldgen

  • outofmemory

Please Sign In or to post your comment or answer

Profile Image

Ram Lakshmanan

Hello Edouard!

 

 I have few observations on your Garbage collection log.

 

1. Heap Size is set to 2GB and not 4GB 

 

 In your comment you have mentioned you are increased your heap size to 4GB on 04/02. But I still see it as ~2GB. Please see the JVM memory size reported:

 

 

 

But note, based on the suggestion that I am going to give below, you don't have to increase to the heap size to 4GB, there is no need for it.

 

2. Unnecessary/wrong JVM arguments

 

 Even though you have allocated 2GB as your heap size, you can notice that peak memory utilization doesn't exceed 412.57MB. It's  due to the fact that several unnecessary/wrong JVM arguments are passed. Due to which memory consumption is not exceeing 421.57MB. It is causing your application to suffer OutOfMemoryError. Below is all the JVM arguments you are passing to your application:

 

 

 Get rid of all the JVM arguments and keep only the following:

 

-XX:+ExitOnOutOfMemoryError
-XX:GCLogFileSize=3145728
-XX:InitialHeapSize=67108864
-XX:MaxHeapSize=2147483648
-XX:MaxMetaspaceSize=268435456
-XX:NumberOfGCLogFiles=5
-XX:+PrintGC
-XX:+PrintGCDateStamps
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+UnlockExperimentalVMOptions
-XX:+UseGCLogFileRotation
-XX:+UseParallelOldGC

 

 

Profile Image

edouard

Thanks Ram for the return, effectively it's due to param MaxRAMFraction=2 which limit heap RAM to 2GB while 4GB are allocated for total memory. But I don't understand which params limit the consumption of 2GB  with the max peak at 412MB ?

Profile Image

Ram Lakshmanan

Hello Edouard!


 There are several unnecessary arguments. Let's get rid of them and then see whether peak utilization is climbing up more than 421MB. After that we can keep adding one argument at a time and see which is influencing this behavior. 

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvm

  • javaheapspace

  • younggen

  • oldgen

  • outofmemory