When tuning Java Garbage Collector you have to be very careful, as you may result to a worst performance instead of a better one.
The GC parameter “-XX:MaxTenuringThreshold” defines how many minor GC cycles an object can stay in the survivor spaces until it finally gets tenured to the old space.
Until java version 1.5.0_05 the maximum value for this parameter was 31. But in all the newest versions of java (1.5.0_06, jdk6, …) the maximum value changed to 15 and for any value we set greater than 15, GC translates it to infinity. Which is very bad, as converts old space to useless space and survivor spaces will be consumed indefinitely by old objects (that normally should moved to old space). This will soon lead to heap fragmentation.
As your old space is useless (as it is empty), server will do much more full ‘stop-the-world’ GCs to defragment heap. This will have an impact to your applications, as you will see many unnecessary pauses.
In order to avoid this situation, you have to set -XX:MaxTenuringThreshold to a value between 0 and 15 (0 means objects will get tenured immediately, and 15 means objects will get aged 15 times at most before tenured).
Democracy requires Free Software
I think this is plain wrong, I have multiple sites with MaxTenuringThreshold set to 31 and they do have objects in old gen. I agree that its nonsense to set the value such high in newer jdks, but its not true, that it means that gc will not use old gen anymore.
I also think the conclusions drawn in this post are wrong. As I understand it, an infinite MaxTenuringThreshold will simply cause objects to stay in Survivor until Survivor is full, at which point they will be moved to OldGen to make room for new objects in Survivor. If you have any observations that prove that no objects will be moved to OldGen when MaxTenuringThreshold > 15, please post that evidence.