-Xms sets the minimum initial heap size available to a Java application. For example, -Xms500m gives the JVM an initial heap size of 500 MB. section 5.2.3
Use -Xms when investigating memory pressure alongside GC behavior and -Xmx. Larger settings can provide short-term relief, but they do not fix memory leaks or unnecessary allocations. section 11.4.3 section 5.2.3
Interpret memory observations before changing the setting:
- Peaks and valleys suggest that garbage collection is reclaiming memory; steadily increasing usage suggests a possible leak. section 11.4.3
- Frequent full GC events and heap usage close to its maximum indicate increasing performance and OutOfMemoryError risk. section 11.4.3
- Treat a larger initial heap as temporary mitigation, then investigate object retention with a heap dump or application changes. section 5.2.3
[GC pause (G1 Evacuation Pause) (mixed), 0.01506789 secs] [GC pause (G1 Evacuation Pause) (mixed), 0.01783456 secs] [GC pause (G1 Evacuation Pause) (mixed), 0.02021234 secs] [Full GC (Allocation Failure) 8192M->6100M(8192M), 2.345678 secs] [GC pause (G1 Evacuation Pause) (mixed), 0.01901234 secs] [GC pause (G1 Evacuation Pause) (mixed), 0.02115678 secs] [Full GC (Allocation Failure) 8192M->5800M(8192M), 2.678901 secs] [GC pause (G1 Evacuation Pause) (mixed), 0.0987654 secs] [GC pause (G1 Evacuation Pause) (mixed), 0.02254321 secs] [Full GC (Allocation Failure) 8192M->5600M(8192M), 2.789012 secs]
Inspect full-GC log entries to connect allocation failure, retained heap, and pause duration with suspected memory pressure. section 11.4.3
