tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kari Scott <>
Subject Re: JMX JVM bug workaround question
Date Wed, 07 Mar 2012 18:13:05 GMT

On Mar 7, 2012, at 11:49 AM, Jess Holle wrote:

How can this be a "low" priority JVM bug!?!

I know. My other motive in posting this was to draw attention to it and maybe get some other
folks to vote for it. :-)

On 3/7/2012 11:21 AM, Konstantin Kolinko wrote:
2012/3/7 Kari Scott<<>>:

We are using Tomcat 7.0.23 with jdk1.6.0_30 on Solaris 10, mod_ajp 1.3  and Apache 2.2.21.

I'm using the following code to retrieve memory information from our JMX server:

ObjectName contextObjectName = new ObjectName("java.lang:type=Memory");
CompositeData memoryUsage = (CompositeData)server.getAttribute(contextObjectName, "HeapMemoryUsage");

This works really well most of the time but we occasionally we get this exception when trying
to retrieve HeapMemoryUsage:
java.lang.IllegalArgumentException: committed = 1607688192 should be<  max = 1607270400

After some digging, I found that it is a bug in the JVM (It occurs in 1.7, too):

My questions for the list then are has anyone else come across this and, if so, how did you
get around it? Is there an alternative way for retrieving used and committed memory from a
JMX MBean?
The issue seems like some threading issue when "max" and "committed"
memory settings are calculated independently at different moments and
fail to pass a consistency check between them.

I think I would wait a while and retry, but only once.

Do you check what Runtime.freeMemory(), Runtime.totalMemory() return
at the same time? Maybe there is so little free memory that it is
worth to worry.

Just to have our bases covered, I've added code to print free/total runtime memory when the
error occurs. I'll let you know if this reveals anything juicy.

Kari Scott
Senior Programmer<>

5520 Research Park Drive
Madison, WI 53711
Office: 608 298 1223
Fax: 608 288 3007

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message