Loading
Feature Disruption - Service Cloud VoiceRead More
Feature degradation | Gmail Email delivery failureRead More

Different Heap Memory Behavior Observed in Java 17 Compared to Java 8 Due to G1GC

Publish Date: May 8, 2026
Description

Symptoms observed after migrating applications from Java 8 to Java 17 may include:

  • Higher baseline heap memory after load tests or during normal operations
  • Heap memory not dropping immediately during idle periods
  • More frequent GC activity during peak traffic hours
  • Gradual heap growth over long-running periods
  • Monitoring alerts triggered based on memory thresholds
  • Different memory usage graphs compared to Java 8 environments

Java 17 uses G1GC as the default garbage collector. Unlike older GC strategies commonly used with Java 8, G1GC prioritizes application performance and lower pause times instead of aggressively reclaiming memory.

As a result, the JVM may intentionally retain heap memory longer and postpone full GC cycles until memory pressure increases. This can create the appearance of continuously growing heap usage even though the application is healthy and memory is still available for reuse.

This behavior is expected and does not necessarily indicate a memory leak.

Knowledge Article Number

005321789

 
Loading
Salesforce Help | Article