United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6653214 MemoryPoolMXBean.setUsageThreshold() does not support large heap sizes
JDK-6653214 : MemoryPoolMXBean.setUsageThreshold() does not support large heap sizes

Details
Type:
Bug
Submit Date:
2008-01-21
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
linux,generic
Sub-Component:
svc
CPU:
x86,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
5.0u12,6
Fixed Versions:
hs14 (b10)

Related Reports
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
FULL PRODUCT VERSION :
Java HotSpot(TM) Server VM (1.5.0_12-b04) for linux-x86, built on May
2 2007 02:13:16 by java_re with gcc 3.2.1-7a (J2SE release)

ADDITIONAL OS VERSION INFORMATION :
Linux 2.6.9-55.0.2.ELsmp #1 SMP Tue Jun 12 17:58:20 EDT 2007 x86_64
libc:glibc 2.3.4 NPTL 2.3.4


A DESCRIPTION OF THE PROBLEM :
Even though MemoryPoolMXBean.setUsageThreshold() accepts a long argument, attempting to set to a large value (for example a very large heap) on a 64-bit OS but using a 32-bit VM results in:

java.lang.IllegalArgumentException: Invalid threshold value > max value of size_t
        at sun.management.MemoryPoolImpl.setUsageThreshold0(Native Method)
        at sun.management.MemoryPoolImpl.setUsageThreshold(MemoryPoolImpl.java:122)



ERROR MESSAGES/STACK TRACES THAT OCCUR :
ava.lang.IllegalArgumentException: Invalid threshold value > max value of size_t
        at sun.management.MemoryPoolImpl.setUsageThreshold0(Native Method)
        at sun.management.MemoryPoolImpl.setUsageThreshold(MemoryPoolImpl.java:122)

REPRODUCIBILITY :
This bug can be reproduced always.

                                    

Comments
EVALUATION

It's a bug in the VM implementation that checks for the range within max integer value.
                                     
2008-01-23
SUGGESTED FIX

Fix the threshold range check in the jmm_SetPoolThreshold function (in services/management.cpp) to check against the max jlong value.
                                     
2008-07-10
EVALUATION

The problem is in 32bit jvm in setting threshold value greater than 3GB but less than 4GB. On 32bit vm max memory allowed is 4GB. So it setting threshold value is
limited to 4GB only.
                                     
2008-11-14
SUGGESTED FIX

In vm threshold check we use max_intx and changing this to max_uintx fixes this problem.
                                     
2008-11-14
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-svc/hotspot/rev/2494ab195856
                                     
2008-12-16
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/2494ab195856
                                     
2008-12-17



Hardware and Software, Engineered to Work Together