java GC options for tomcat6 service

G

Gerard H. Pille

I'd like to pass some java GC options when starting a tomcat6 service
on a windows server, eg. -Xloggc -XX:+UnlockExperimentalVMOptions -XX:
+UseG1GC

Tomcat (or the jvm) seems to disregard my options, or has trouble with
them, like "-XX:+PrintGCTimeStamps" would fail with "unknown option
+PrintGCTimeStamps". The GC-log is never created.

I'm entering these options in the gui:

tomcat6w //ES//tomcat6


I know my options are correct, when I start a TestGCThread with them,
they have the desired effect.

Any idea what I could be doing wrong?

Thanks,

Gerard
 
L

Lew

I'd like to pass some java [sic] GC options when starting a tomcat6 [sic] service
on a windows [sic] server, eg. [sic] -Xloggc -XX:+UnlockExperimentalVMOptions -XX:
+UseG1GC

Tomcat (or the jvm [sic]) seems to disregard my options, or has trouble with
them, like "-XX:+PrintGCTimeStamps" would fail with "unknown option
+PrintGCTimeStamps". The GC-log is never created.

If it's an unknown option, that means that that version of the JVM doesn't
support that option. You might have to research available options for the JVM
that Tomcat's using.
I'm entering these options in the gui [sic]:

tomcat6w //ES//tomcat6


I know my options are correct, when I start a TestGCThread with them,
they have the desired effect.

Any idea what I could be doing wrong?

Do you have more than one version of Java on the system that's running Tomcat?
If so, which version is Tomcat using?

References to help answer these questions and yours:
<http://tomcat.apache.org/tomcat-6.0-doc/setup.html>
<http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html>

It looks like you need options "--JavaHome" or "--Jvm" as well as "--JvmOptions".
 
G

Gerard H. Pille

If it's an unknown option, that means that that version of the JVM doesn't
support that option.  You might have to research available options for the JVM
that Tomcat's using.
I would have expected "unknown option -XX:+PrintGCTimeStamps", not
"unknown option +PrintGCTimeStamps".
It looks like you need options "--JavaHome" or "--Jvm" as well as "--JvmOptions".

Thanks Lew, but maybe you are not familiar with the "tomcat6w" gui (as
I was before yesterday): there is a box to enter the "JvmOptions", and
that's what I do. As far as I can see, there's only one JRE on that
system, but even that is specified in the service window.
 
L

Lew

I would have expected "unknown option -XX:+PrintGCTimeStamps", not
"unknown option +PrintGCTimeStamps".

Then you would have been wrong.

"-XX:" introduces the option, it's not part of the option. Anyway, the
message is perfectly clear even with unrealized expectations, so that's a
non-issue.
Thanks Lew, but maybe you are not familiar with the "tomcat6w" gui [sic] (as
I was before yesterday): there is a box to enter the "JvmOptions", and
that's what I do. As far as I can see, there's only one JRE on that
system, but even that is specified in the service window.

Right - you didn't say you had already used "JavaHome" or "Jvm", which is why
I mentioned them. What version of the JRE is it? It might not be a bad idea
to mention that since we're talking about what version of Java supports what
options.

What do you mean "as far as I can see"? You can see everything on that
machine, so either you have only one version of Java or you don't. Which is it?
 
G

Gerard H. Pille

Then you would have been wrong.

"-XX:" introduces the option, it's not part of the option.  Anyway, the
message is perfectly clear even with unrealized expectations, so that's a
non-issue.

Then something is wrong with the gui. Maybe each option has to be put
on a new line in the box?

I have no jdk on that system (yet), is there any other way to see the
options the service is running with?
It looks like you need options "--JavaHome" or "--Jvm" as well as "--JvmOptions".
Thanks Lew, but maybe you are not familiar with the "tomcat6w" gui [sic] (as
I was before yesterday): there is a box to enter the "JvmOptions", and
that's what I do.  As far as I can see, there's only one JRE on that
system, but even that is specified in the service window.

Right - you didn't say you had already used "JavaHome" or "Jvm", which iswhy
I mentioned them.  What version of the JRE is it?  It might not be a bad idea
to mention that since we're talking about what version of Java supports what
options.

What do you mean "as far as I can see"? You can see everything on that
machine, so either you have only one version of Java or you don't.  Which is it?

I'm new to Windows Server 2008, I may be overlooking things. Java 1.6
update 21. My options work perfectly from the command-line, where
"java -version" returns the same version.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top