Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is tomcat default GC option?

in catalina.sh I set JAVA_OPTS like this.

JAVA_OPTS="-server -Xms2048m -Xmx2048m"

in this case what is default GC option?

I think default option is serial GC.(-XX:+UseSerialGC)

thanks.

like image 417
user1698932 Avatar asked Nov 01 '25 00:11

user1698932


2 Answers

This article says:

On server-class machines running the server VM, the garbage collector (GC) has changed from the previous serial collector (-XX:+UseSerialGC) to a parallel collector (-XX:+UseParallelGC). You can override this default by using the -XX:+UseSerialGC command-line option to the java command.

As you are forcing the server VM using -server, this also applies to you.

You can always double check this with JConsole through JMX.

like image 100
mindas Avatar answered Nov 02 '25 14:11

mindas


Unless Tomcat sets something different it's the same as the default for the JVM.

like image 31
user207421 Avatar answered Nov 02 '25 15:11

user207421