Sunday, January 8, 2023

Memory Issue: Step by step troubleshooting

 Quite often your application is going out of memory. Here is what you need to check the following:

Review the memory configuration

1. -Xmx : Max heap memory

2. -XX:NewSize : Size of new generation

3. XX:MaxNewSize : Max size of new generation

4.-XX:+UseConcMarkSweepGC  : Flag to use GC type

5. -XX:CMSInitiatingOccupancyFraction : If GC type is CMS ,will run after old generation occupied this perdentage

6. XX:SurvivorRatio: The ratio it will survive of the eden space

7. -XX:ConcGCThreads : //Number of threads with which GC will run, 2,3 good enough

Check the various sections:

JVM used memory

Old gen percentage usage

Par-eden space

Par-survivor space

Take a look at the histogram

Identify any memory leakage in the application code through debugging.

Others should not be a problem: Meta spaces/ code cache, compressed class cache.

Take a look at the memory availability on the m/c
free -m

free -g

du -h -d1 // disk usage