We migrated our application from CMS to G1GC and post that the heap monitoring system is triggering high heap usage alerts. Max heap usage is over 80% of total heap and is almost double of what we used to get with CMS. The memory graph is in zig-zag pattern with high and low usage.
Going through the GC log we noticed that in-order to reduce the frequency of GC cycle, G1GC is allocating around 50% of heap to Eden space. Majority of objects in Eden are temporary objects which get cleared on next GC. Since G1GC delays the GC cycle, major portion of reported high heap consists of temporary objects.
The monitoring system basically captures the Memory_HeapMemoryUsage MBean to get the memory snapshot. But with the way G1GC works, this data is misleading. We can change the way monitoring system captures the data but then it will become G1GC specific?
Is there any better approach which is independent of GC implementation?