tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: JMX JVM bug workaround question
Date Wed, 07 Mar 2012 17:21:31 GMT
2012/3/7 Kari Scott <Kari.Scott@cdw.com>:
>
>
> 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:
>
> javax.management.RuntimeMBeanException:
> 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):
>
>  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7100266
>
>
> 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.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message