Friday, August 5, 2011

GC overhead limit exceeded

-           
      Error: java.lang.OutOfMemoryError: GC overhead limit exceeded



      Description of the problem: The process is running a very heavy GC activity, which means most of the CPU is utilized for GC and not enough CPU is left for execution of application logic.
-          Root cause: Two possible root causes:
o   GC configuration is not proper. Typically if Eden-Space allocation (Xmn) for your process is very low, you can see this issue. (Exact issue can be identified by proper memory profiling of your application)
o   Application is suddenly loading too much of data in memory.
o   Memory leak in application.
-          Solution: Following are possible solutions (In order of complexity):
o   Please check the java code specified in stacktrace. If lot of data is being loaded by the application; try to cut it down into chunks.
o   Please try configuring ‘Xmn’ value to 1/3rd of your total heap size. (An application should always have same value for Xms and Xmx. Value of Xmn should be in the range of 0.25 to 0.5 time your xms/xmx - start with 0.33 times!)
o   If all these suggestions do not resolve your issue, memory profiling of your application code will be required. (Preferably with similar data load)

No comments:

Post a Comment