According to the Java Platform, Standard Edition HotSpot Virtual Machine Garbage Collection Tuning Guide section titled "Generations"
When the young generation fills up, it causes a minor collection in which only the young generation is collected
and:
Eventually, the tenured generation will fill up and must be collected, resulting in a major collection, in which the entire heap is collected.
So if the application has finished the allocation phase, and throughout the execution of the application, the young and tenured generations are never filled (at all, at any stage), then gc will not occur even once?
If it will occur, what is the reason? Because such seems contrary to the linked documentation.
So if the application finished the allocation phase, and throughout the execution of the application, the young and tenured generations are not filled up (at all, in any stage), the gc will not occur even once ?
Yes. If the young and tenured generations are not filled (at any stage) then the gc
may not occur (even once). It's up to the JVM runtime to manage memory, and that includes deciding when (or if) garbage collection occurs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With