Hi Mohammad,
As per my observations on your heap memory, it is growing up but after some time it is dropping down all the way to the bottom. If you observe the below screenshot is taken from the attached GC report.
This indicates to me that may be because of the traffic, memory is increasing at some particular time, first at 03:02 PM and then at 5:21 PM. If you confirm that at this particular time interval there will be heavy traffic then you might have to increase the heap size. If this is not by the traffic then follow the below steps to diagnose the memory problems:
You can diagnose Memory problems either through a manual or automated approach.
Manual approach
In the manual approach, you need to capture heap dump as the first step. A heap dump is a snapshot of memory, which shows all the objects in memory, values contained by those objects, and their references. You can capture heap dump using one of the 7 approaches given here. But an important criterion is: You need to capture the heap dump right before OutOfMemoryError is thrown. If you are going to capture a heap dump after OutOfMemoryError has occurred, then leaking objects can get garbage collected, and it will become hard (or even impossible) to diagnose the problem. A better way to collect heap dumps is by setting the below JVM parameters for your application. This will help you out when an OOM error gets it will create the heap dump at mentioned file path.
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=<filepath/heapdump.bin>
Once heap dumps are captured, you need to import the heap dumps from your production servers to your local machine. From your local machine, you can use heap dump analysis tools like jHat, HeapHero, Eclipse MAT to analyze the heap dumps. Here is a video tutorial, which may assist you with it.
Automated approach
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.
Edit your Comment