4

i've a problem with our jmx monitoring. we monitor the perm gen of some jvms with jmx. but from time to time the name of the mbean changes from "PS Perm Gen" to "Perm Gen" or vice versa. it happens with a restart of the tomcat server, but not with every restart.

the jvm version is 1.5.0_16.

has anyone experienced this problem and perhaps has a solution?

Christian
  • 4,645
  • 2
  • 23
  • 27

1 Answers1

7

You are presumably using different garbage collectors. The name of the PermGen memory area is different depending on the selected garbage collector:

  • -XX:+UseParallelGC : PS PermGen
  • -XX:+UseConcMarkSweepGC : CMS PermGen
  • -XX:+UseSerialGC : PermGen

Looks like Tomcat is started up with either the serial ( stop-the-world ) collector or the parallel collector.

Verify any inconsistencies in the startup scripts or the environment settings.

Update: The garbage collector and memory settings are influenced by the JVM ergonomics , which means that they get auto-selected at startup based on the characteristics of the computer the JVM is running on. I can't find any references right now but IIRC they are based on CPU architecture and total memory available.

I suggest you specify one of the garbage collectors in your startup scripts. Depending on your application, it might not be good to have a random garbage collector picked.

Robert Munteanu
  • 1,542
  • 5
  • 22
  • 38
  • the garbage collector is not explicitly set for the tomcat. is there a way it could change dynamically or influenced by other parameters? – Christian Feb 02 '10 at 07:17
  • See my update. Although I don't think the garbage collector could be swapped at runtime. This is the Sun JVM, right? – Robert Munteanu Feb 02 '10 at 08:40
  • yes, it is sun. – Christian Feb 02 '10 at 09:06
  • i've read your link to jvm ergonomics. the tomcat is running on a vmware guest. but we didn't change cpu or ram on this guest. i tried changing the parameters for heap space on another system, but with no result to the mbeans. – Christian Feb 02 '10 at 09:26
  • Another avenue to investigate is moving to Java 6 . Java 5 is EOL as far as I know and if this is indeed a bug you won't be able to get support through regular channels. – Robert Munteanu Feb 02 '10 at 10:01
  • 1
    Had similar issue, moving to 1.6 fast the good solution. And in our case took only 6 hours to the main developer solve the problems. Cheaper thant the hours that I spend debuging the problem. – Carlos Garcia Feb 01 '11 at 11:00
  • had the same effect again with another tomcat. it is definitely the jvm auto adjust of parameters. – Christian Jan 30 '13 at 09:42