java GC options for tomcat6 service

Discussion in 'Java' started by Gerard H. Pille, Apr 14, 2011.

  1. 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
     
    Gerard H. Pille, Apr 14, 2011
    #1
    1. Advertising

  2. Gerard H. Pille

    Lew Guest

    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/wikipedia/commons/c/cf/Friz.jpg
     
    Lew, Apr 14, 2011
    #2
    1. Advertising

  3. On 15 apr, 00:41, 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".
    >
    >
    > 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.
     
    Gerard H. Pille, Apr 15, 2011
    #3
  4. Gerard H. Pille

    Lew Guest

    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/wikipedia/commons/c/cf/Friz.jpg
     
    Lew, Apr 15, 2011
    #4
  5. On 15 apr, 13:15, Lew <> 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.
     
    Gerard H. Pille, Apr 16, 2011
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cliff  Martin
    Replies:
    1
    Views:
    3,055
    Larry Smith
    Jan 31, 2007
  2. jacksu
    Replies:
    0
    Views:
    521
    jacksu
    Oct 9, 2007
  3. Replies:
    0
    Views:
    481
  4. ruds
    Replies:
    27
    Views:
    1,277
    Arne Vajhøj
    Dec 16, 2007
  5. Utkado
    Replies:
    2
    Views:
    2,154
Loading...

Share This Page