Open JulienBertrand opened 1 year ago
Hello,
For the use of G1GC:
I think the usage of the GC is a good thing to look at but at this point we cannot affirm which one is the best. And without looking at the options it is worse. For me, we cannot implement a rule at this point.
For use of UseStringDeduplication
To understand what the option does: https://dzone.com/articles/usestringdeduplication It seems to be a good idea to look at the option, even if its use is not quite simple and the improvement not always easy to see. However it is a "good practice" and we do not detect that in ecoCode and I am not sure we can throw a bad practice systematically if we do not found this option in the GC options wherever they are.
For the last reason, I think we cannot implement this rule in ecoCode.
\newpage
Optimized JVM: Tune your Garbage collector
Platform
Main caracteristics
Severity / Remediation Cost
Rule short description
Using
-XX:+UseG1GC
and-XX:+UseStringDeduplication
flags to tune your JVM to be more energy efficient.Rule complete description
Text
Using
-XX:+UseG1GC
and-XX:+UseStringDeduplication
flags to tune your JVM to be more energy efficient.The
-XX:+UseG1GC
argument will change the garbage collector behaviorto be more energy efficient. Note that the G1GC is available since Java 8 and is the default value since Java 11.The
-XX:+UseStringDeduplication
argument will attempts to eliminate duplicate strings as a part of the collection processCode samples:
Documentation:
HTML
Implementation principle
-XX:+UseG1GC
(if 8 < java < 11) and-XX:+UseStringDeduplication
add a code smell