Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   java GC options for tomcat6 service (http://www.velocityreviews.com/forums/t746824-java-gc-options-for-tomcat6-service.html)

Gerard H. Pille 04-14-2011 08:53 PM

java GC options for tomcat6 service
 
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

Lew 04-14-2011 10:41 PM

Re: java GC options for tomcat6 service
 
On 04/14/2011 04:53 PM, Gerard H. Pille wrote:
> 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".

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedi.../c/cf/Friz.jpg

Gerard H. Pille 04-15-2011 06:07 AM

Re: java GC options for tomcat6 service
 
On 15 apr, 00:41, Lew <no...@lewscanon.com> wrote:
>
> 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.

Lew 04-15-2011 11:15 AM

Re: java GC options for tomcat6 service
 
Gerard H. Pille wrote:
> Lew wrote:
>> 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".


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.

>> 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 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?

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedi.../c/cf/Friz.jpg

Gerard H. Pille 04-16-2011 08:46 PM

Re: java GC options for tomcat6 service
 
On 15 apr, 13:15, Lew <no...@lewscanon.com> wrote:
> Gerard H. Pille wrote:
> > Lew wrote:
> >> 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".

>
> 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.


All times are GMT. The time now is 12:08 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.