Out of Memory occurs when the Garbage Collector is not able to make any space for creating new objects, and the Heap memory space cannot be expanded as well. This is a very critical issue because if the memory space becomes insufficient, then the application will not start its operation. For example, once a call is made, if there is a screen taking up more memory than the limit set for Heap Memory, it will result in an Out Of Memory Error in the Heap Space.
Check the Heap Memory usage pattern at the time the Out Of Memory Error occurred on the JVM Stat. Analyze the cause of Out of Memory Error by reviewing the status and source analysis of the active transactions that were running at the corresponding time.
Image1. Analysis of Out of Memory Due to Excessive Fetch Count
Step1.1 Check the Error Time on the Performance Trend
Step1.2 Analysis of JVM Heap Memory Pattern with JVM Stat
(!) Check Results: The Heap Memory usage went up as high as 1491.783MB. You will discover that the GC Count and the CPU usage also increased at the corresponding time, and note the server error triggered by the lack of memory space.
Step1.3 Analysis of Active Transaction Running at the Time of Error
You can note that the problematic transactions running at the corresponding time are the same requests sent repeatedly several times by the same IP user for 30 seconds. The corresponding transactions’ individual fetch count is 6375, a relatively high value, and the repeated executions of the same request are increasing the resource usage.
Step1.4 Check Exception
You can see that Out of Memory Error has occurred during the corresponding transaction process due to the lack of memory.
It has been confirmed that the cause of Out Of Memory Error was the increase in memory usage due to excessive fetching job. The transactions which have triggered the Out of Memory Error are mostly processing reporting data and hence, it will retain a high volume of query data in the memory during the process of running the Data Set. As a result, it has caused a temporary shortage in memory. Therefore, if you use the page transmission by utilizing the First Row method, you can maintain the size of the data which needs to be retained in the Heap memory at a standard level so as to reduce the possibility of an Out of Memory Error.