Profile Image

What is Garbage collection tuning: -XX:+AggressiveHeap?

What is Garbage collection tuning: -XX:+AggressiveHeap? Have you used this JVM argument before? What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvm-argument

  • xx-aggressiveheap

  • x-aggressiveheap

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky



You can let JVM to inspect server status and try to optimize resources with:






AggressiveHeap is a part of garbage collection tuning routine. This option inspects the server resources (number of processors and size of memory), and attempts to set various parameters to be optimal for long-running, memory allocation-intensive jobs. It was originally intended for machines with large amounts of memory and a large number of CPUs, but in the J2SE platform, version 1.4.1 and later it has shown itself to be useful even on four processor machines. The physical memory on the servers must be at least 256 MB before AggressiveHeap can be used. The size of the initial heap is calculated based on the size of the physical memory and attempts to make maximal use of the physical memory for the heap (that is, the algorithms attempt to use heaps nearly as large as the total physical memory).


Default Value:


Disabled by default






Arguments related:


TODO link UseG1GC, MinHeapFreeRatio, MaxHeapFreeRatio, Xmx, Xms, UseSerialGC, USeParNewGC, UseParallelGC, UseZGC, MaxHeapFreeRatio


Related Posts



If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvm-argument

  • xx-aggressiveheap

  • x-aggressiveheap