While looking at possible JVM flags for optimizing launching startup time of my RCP product, I found these attractively-named -XX:UseFastEmptyMethods
and -XX:UseFastAccessorMethods
.
It seems that those flags were available on JDK-6 (and on by default), while they were defaulted to off on JDK-7. Also, I read that the trade-off for this optimization is that they do not increase method invocation counters.
What is the impact of not using invocation counters? Does that affect garbage collection?
It is for getting the invocation count of methods correctly so that the VM can identify the hotspots in your code better.
Following the discussion from here
If you're on JDK6, you may need to include these two VM flags in your target Java application:
-XX:-UseFastEmptyMethods -XX:-UseFastAccessorMethodsOtherwise empty methods and accessor methods will not show up in the list, because the "fast" version doesn't increment the invocation counter for these methods. In JDK7 these two flags default to false, so you don't have to bother setting them to false explicitly.
See Also :
UseFastEmptyMethods/UseFastAccessorMethods considered harmful