I understood that the algorithm for the concurrent collector is the following ;
1 - Allocate objects in the young generation
2 - If available memory in the young generation < threshold
2.1 - Collect dead objects in the young generation
2.2 - Increment age of still alive objects of the young generation
2.3 - Move old (age > threshold) alive objects from the young to the tenured generation
3 - If available memory in the tenured generation < threshold start a full gc which will be performed concurrently and will cause 2 pauses, one at the start and one at the end of the gc.
Please let me know if this is correct since I based part of my optimization process on this behavior and the conclusion it leads ; generating lots of garbage, even short lived, has two negative consequences ;
- small collections will be more frequent therefore leading to a small performance penalty,
- objects grew older more quickly and are more likely to be moved to the tenured generation, therefore increasing the frequency of full gc.
It appeared that the occurence of a full gc was not acceptable for my needs since it breaks the steadiness of the animation (frame rate drops for a few frames).
From that, two options may be choosen ;
- either I choosed to implement my own full memory management system (with a realtime VM or with a java system like javolution, object pools,…),
- either I tried to lower the occurence of full gc, ideally removing any occurence from my main game phase (i.e. I trigger full gc during low interactive phase like level loading, … and I lower garbage creation in the interactive part).
I’m investigating the second option so any clue to lower garbage collection is always welcome.
Thanks
Vincent