You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kari Scott <Ka...@cdw.com> on 2012/03/07 18:10:28 UTC

JMX JVM bug workaround question


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?

Thank you,
-Kari


_________________________________
Kari Scott
Senior Programmer
kari.scott@cdw.com<ma...@cdw.com>

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







Re: JMX JVM bug workaround question

Posted by Kari Scott <Ka...@cdw.com>.



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



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
kari.scott@cdw.com<ma...@cdw.com>

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







Re: JMX JVM bug workaround question

Posted by Jess Holle <je...@ptc.com>.
How can this be a "low" priority JVM bug!?!

On 3/7/2012 11:21 AM, Konstantin Kolinko wrote:
> 2012/3/7 Kari Scott<Ka...@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
>
>


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


Re: JMX JVM bug workaround question

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/3/7 Kari Scott <Ka...@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