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?
The JVM option,-verbose:dynloadprovides detailed information as each class is loaded by the JVM, including:The class name and packageFor class files that were in a . jar file, the name and directory path of the . jarDetails of the size of the class and the time taken to load the classThe data is written out to stderr.
options configuration file. The default location of this file is config/jvm. options (when installing from the tar or zip distributions) and /etc/elasticsearch/jvm. options (when installing from the Debian or RPM packages).
The following three JVM options specify initial and max heap size and thread stack size while running Java programs: -Xms - set initial Java heap size -Xmx - set maximum Java heap size -Xss - set java thread stack size. Parameter 2: Garbage Collector.
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
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