Hello Jelocop!
Greetings. Your GC behaviour is quote intriguing. I would like to share some observations.
a. Acute Memory Leak
Your application is suffering from memory leak. Look the black dotted line that I have pasted in your Garbage Collection graph. This line shows where the memory utilization drops after Full GC event. You can see this black line is going at 20-degree. It's a clear indication your application is suffering from acute memory leak.
Below if teh GC behaviour of an healthy application. You can notice the black dotted line is going at 0-degree. It's an indication that this application doesn;t have any memory leak.
Note, you application is suffering from an acute memory leak. That's why application is run for few hours. However after few hours memory leak stalls your application. So you need to do heap dump anlaysis to identify memory leak in your application. You can use root cause analysis tools like yCrash - which automatically captures application-level data (thread dump, heap dump, Garbage Collection log) and system-level data (netstat, vmstat, iostat, top, top -H, dmesg, kernel parameters…). Besides capturing the data automatically, it marries these two datasets and generates an instant root cause analysis report. Below is the report generated by the yCrash tool when the above sample program is executed:
Fig: yCrash tool pointing out the root cause of OutOfMemoryError
You can notice the yCrash tool precisely pointing out the root cause of memory leak. You can register here to get a 14 day trial of yCrash.
b. Passing -XX:-UseAdaptiveSizePolicy JVM argument
Note, below is the recommendation given by the GCeasy tool. It can help to improve your GC pause times (however it will not prevent Memory Leak).
- 29 min 32 sec 797 ms of GC pause time is triggered by 'Ergonomics' event. GC ergonomics tries to grow or shrink the heap dynamically to meet a specified goal such as minimum pause time and/or throughput..
Solution:
You can pass '-XX:-UseAdaptiveSizePolicy' argument. It will disable JVM from dynamically adjusting the sizes of the young generation and old generation at runtime based on workload characteristics. Additionally it will also disable the garbage collector from trying to meet default GC throughput goals. It will minimize the number of Ergonomics GC events that are getting triggered.
GC Settings change
Edit your Comment