Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.OutOfMemoryError: Compressed class space

Jeetendra Dash December 5, 2018

Hello,

Our Jira server crashed and I got this error in log file

/rest/scriptrunner/behaviours/latest/validators.json [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Compressed class space

java.lang.OutOfMemoryError: Compressed class space

Below is the memory graph for our Jira application.But below is the image after Jira starts

Below is the memory graph

memorygraph.PNG

Could you please help us here?

Thanks

3 answers

0 votes
Jeetendra Dash December 7, 2018

Hi Kiran,

Thanks for your help here.

Below is the current memory configuraions with out setting of above parameters.

Could you please suggest here?

servermemory.PNG

Kiran Panduga {Appfire}
Community Champion
December 9, 2018

Hi @Jeetendra Dash,

I would still suggest to add the below parameters

  • Add -XX:MaxMetaspaceSize=1GB
  • Add -XX:CompressedClassSpaceSize=1GB

G1 (Garbage Collector ) is already set to 1GB (-XX:+UseG1GC), In order to manage your heap available space you need to specify these command line options whenever you run java:

  • -Xms:<size>, which sets the initial and minimum heap size
  • -Xmx:<size>, which sets the maximum heap size

For example:

java -Xms:4g -Xmx:6g

Thanks,

Kiran.

Jeetendra Dash December 10, 2018

Hello Kiran,

Thank you very much for your answer.

For us we set these two values

-Xms:512MB

-Xmx:16gb

I have confusion to set -XX:MaxMetaspaceSize=1GB,because  from above memory diagram, -XX:MaxMetaspaceSize already exceeds 1 GB and If I set this parameter to 1GB,It may create a problem

Please suggest if we restrict -XX:MaxMetaspaceSize  this to 1gb,Will it be a problem?

Thanks

Jeetendra

Kiran Panduga {Appfire}
Community Champion
December 10, 2018

Hi @Jeetendra Dash

The Initial image shared shows us  MetaspaceSize set to 580MB and second image shows the value increased to 1724MB.

-XX:MaxMetaspaceSize limits the maximum size of Memory allocation. JIRA has exceeded this fixed block for loading class files.

 

In Java 1.8, this is an expected behaviour and no action is required.

Please refer to this KB article:

https://confluence.atlassian.com/jirakb/the-jira-applications-memory-information-screen-displays-0-free-metaspace-873885725.html

Thanks,

Kiran.

Jeetendra Dash December 19, 2018

Hello Kiran,

Hope you are doing good

Currently we have Jira instance which is running on VM.

VM has 32 gb RAM and 8 cpus

We set JvmMs=512 mb and JvmMx=8gb.

we have around 14000 issues and number of active users are around 1000.

But still we are facing slowness to access our application.

Do you feel the memory settings are correct?or do we need to modify these values?

If you see above diagram codecache is almost filled.Can we increase this value?

Could you please provide some suggestions here.

Thanks

Jeetendra

Kiran Panduga {Appfire}
Community Champion
December 20, 2018

Hi @Jeetendra Dash

Xms  and Xmx refers to the minimum and maximum memory (heap) size allocation.

Consider setting Xms and Xmx to the same value, as this can decrease the time GC takes to occur, as it will not attempt to resize the heap down on each collection.

 

If you are encountering out of memory issues, please refers to this KB article,

https://confluence.atlassian.com/confkb/how-to-fix-out-of-memory-errors-by-increasing-available-memory-154071.html

Additionally, there would be many reasons behind slow performance of JIRA application such as Anti virus, memory and CPU usage, Concurrent User accessing JIRA, SSL, Network issues, XML backups etc.

Please refer to the below Atlassian KB article for additional information:

https://confluence.atlassian.com/jirakb/crashes-and-performance-issues-troubleshooting-203394749.html?_ga=2.153537530.336638948.1545299690-1396967577.1545204375

 

Thanks,

Kiran.

0 votes
Jeetendra Dash December 5, 2018

Hello Kiran,

Thanks for your quick reply.

We are runing Jira as a service and below is the jvm parameters we set and

 parameter "-XX:CompressedClassSpaceSize" is not set. and what is the recommended value for this parameter

-Djava.awt.headless=true
-Datlassian.standalone=JIRA
-Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
-Dmail.mime.decodeparameters=true
-Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory
-Dcatalina.home=D:\Atlassian\JIRA
-Dcatalina.base=D:\Atlassian\JIRA
-Djava.endorsed.dirs=D:\Atlassian\JIRA\endorsed
-Djava.io.tmpdir=D:\Atlassian\JIRA\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=D:\Atlassian\JIRA\conf\logging.properties
-XX:+UseG1GC
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-XX:+PrintGCCause
-Xloggc:D:\atlassian\jirahome\log\atlassian-jira-gc-%t.log
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=5
-XX:GCLogFileSize=20M
-Dfile.encoding=UTF-8

 

Thanks

Jeetenfta

Kiran Panduga {Appfire}
Community Champion
December 5, 2018

Hi @Jeetendra Dash,

 

Based on the image shared, it shows Metaspace 100% utilized, If you are using JAVA 8,

I would recommend to add the below entires in the existing JVM parameters and then run JIRA as service.

  • Add -XX:MaxMetaspaceSize=1GB
  • Add -XX:CompressedClassSpaceSize=1GB

I hope this will resolve the issue.

Thanks,

Kiran.

0 votes
Kiran Panduga {Appfire}
Community Champion
December 5, 2018

Hi @Jeetendra Dash,

Looks like the JIRA application is configured with the -XX:CompressedClassSpaceSize JVM parameter in setenv.sh file.

Increase the -XX:CompressedClassSpaceSize value and restart the application.

This should address the java.lang.OutOfMemoryError: Compressed class space issue.

Thanks,

Kiran.

Suggest an answer

Log in or Sign up to answer