Hi,
We are currently on elasticsearch version 7.0.1 and about to upgrade to 7.8. In our elastic search logs, we observe a warning "OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release."
On analysis, we found that CMS gc is deprecated from java 9 onwards and be completely removed from java 14. Currently, we are on java 11.
We found that this warning can be avoided by replacing CMSGC with G1GC (garbage collectors).
Following is the code snippet for configuring GC:
## GC configuration
8-13:-XX:+UseConcMarkSweepGC
8-13:-XX:CMSInitiatingOccupancyFraction=75
8-13:-XX:+UseCMSInitiatingOccupancyOnly
## G1GC Configuration
# NOTE: G1 GC is only supported on JDK version 10 or later
# to use G1GC, uncomment the next two lines and update the version on the
# following three lines to your version of the JDK
# 10-13:-XX:-UseConcMarkSweepGC
# 10-13:-XX:-UseCMSInitiatingOccupancyOnly
14-:-XX:+UseG1GC
14-:-XX:G1ReservePercent=25
14-:-XX:InitiatingHeapOccupancyPercent=30
Please suggest what impact can be seen after changing this JVM option. Is there any performance impact or what possibly could get affected if we switch to G1GC from CMSGC?
Thanks in advance
If there is any other alternative solution present to remove "OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release." warning, Please suggest.
My version of Elastic runs correctly on Java 8, so for sure your Java 11 should be fine, but you have to set up correctly java itself, on Linux machines.
Consider to use this bash script, to setup you JDK. Please read it carefully and update the path of you java folder:
We are in java 11 and CMS garbage collector is deprecated from java 9 onwards, that is the reason for this warning. There is no issue with java configuration.
To remove this warning about CMS getting deprecated, we have to use G1GC. So, I wanted to check what impact can be seen after changing this JVM option. Is there any performance impact or what possibly could get affected if we switch to G1GC from CMSGC?
Please look into it.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.