0

I am getting an issue in dozer mapping. I have nested lists upto 5 levels to map that are supposed to create 100's of objects. This is occurring for multiple different calls with different data sets.

org.dozer.MappingException: java.lang.OutOfMemoryError: GC overhead limit exceeded at org.dozer.util.MappingUtils.throwMappingException(MappingUtils.java:82)

Gourav Joshi
  • 2,349
  • 2
  • 25
  • 43
  • Just a note: the last update of the Dozer library was in 04/2014. Perhaps you should use another mapping library. – dieter Jan 19 '17 at 08:00

1 Answers1

0

You are running out of heap.

Increase heap memory available to JVM using Xmx argument.

More info about this error (taken from here):

The detail message "GC overhead limit exceeded" indicates that the garbage collector is running all the time and Java program is making very slow progress. After a garbage collection, if the Java process is spending more than approximately 98% of its time doing garbage collection and if it is recovering less than 2% of the heap and has been doing so far the last 5 (compile time constant) consecutive garbage collections, then a java.lang.OutOfMemoryError is thrown. This exception is typically thrown because the amount of live data barely fits into the Java heap having little free space for new allocations. Action: Increase the heap size. The java.lang.OutOfMemoryError exception for GC Overhead limit exceeded can be turned off with the command line flag -XX:-UseGCOverheadLimit.

You may want to try another mapping framework, for example Orika

Community
  • 1
  • 1
rkosegi
  • 12,129
  • 5
  • 46
  • 75
  • Thanks for your response. Actually we are getting this exception in production environment only and being an e-commerce website there are thousands of users accessing this concurrently. Now suppressing the exception by the settings you mentioned may create performance issues so we can't go that way. So as you said the only way to fix this is to increase the heap size. Besides, I am not sure about dozer internal implementation but I believe doing the manual conversion instead of Dozer may fix this issue. Any thoughts? – Neeraj Pandit Jan 19 '17 at 08:19