3

I am getting a lot of Humongous Allocations when using G1GC.

The server is receiving requests from about 300 clients at a time, often for large datasets of different types from the database.

This is likely what is causing the Humongous Allocations, however, the volume of calls makes it quite hard for me to determine exactly which call is causing them just based on time since there is so much going on.

Is there any way to get the JVM to print and log the class names of the Humongous objects?

opticyclic
  • 7,412
  • 12
  • 81
  • 155
  • 2
    I don't think that will be very helpful, even if it existed. Most objects in Java are small and contain only a handful of references and primitives. To actually need a huge contiguous chunk of memory the object is usually an array. The class name of the array will usually not be too informative, especially if it's an array hidden in an `ArrayList`, where it's defined as `Object[]`. – RealSkeptic Feb 11 '20 at 16:24
  • Would the info be available in a heap dump? – opticyclic Feb 11 '20 at 16:29
  • what is the _problem_ though? humongous allocations are kind of normal – Eugene Feb 12 '20 at 11:00
  • The problem is that the heap gets fragmented then Full GC kicks in due to a failed allocation and stop the world happens for 20-30s. If I can identify the suspect list I can try to optimise the code slightly. – opticyclic Feb 12 '20 at 14:41

0 Answers0