Increase in Eden Space and Old Gen peak values

496 views Asked by At

After Java 17 upgrade, JVM heap memory started to increase. When we check the memory metrics, sizes of the Eden Space and the Old Generation fluctuating and peak values are increasing.

There seems no increase in lower values of Old Gen but the problem is it is increasing so fast and the peak value is also increasing.

When I inspect the memory dumps, there seems no potential leak. Can we say that there is a memory leak in here?

enter image description here

EDIT: We have upgraded from Java 11 to 17. I don't see any unusual activity in GC metrics. enter image description here

Before the Upgrade Metrics: The heap usage is much lower: enter image description here

I don't see such activity in GC metrcis: enter image description here

1

There are 1 answers

0
user1874594 On

Identify Increased Heap Memory Vs Memory Leak situation

  • Java 17 changed the default garbage collector (GC) from Parallel GC to G1 GC. - G1 GC divides the heap into smaller regions and adapts the size and number of regions based on the application's behavior & has a different way of handling young and old generations, which may affect the heap usage patterns

    To verify run your application with different GCs and compare the results. e.g. XX:+UseParallelGC option to switch back to Parallel GC, or try other GCs such as ZGC or Shenandoah GC

    Use the -Xlog:gc option to enable GC logging and analyze the GC behavior in more detail.

  • If the GC is not the cause of your increased heap memory usage, poss. memory leak in your application i.e. an object is no longer needed by the application, but it is still referenced by other objects and cannot be reclaimed by the GC. To detect this use tools such as Eclipse Memory Analyzer, to analyze memory dumps