Request for review: 8020530 Non heap memory size calculated incorrectly

Vladimir Kempik vladimir.kempik at
Tue Aug 20 04:44:33 PDT 2013

Hi all,

Could I have a couple of reviews for this change?

Running WebLogic server with 1.8.0 encounters this error:

Caused by: java.lang.IllegalArgumentException: committed = 86482944 
should be < max = 50331648


         at Method)


        ... 37 more

There is a bug in jmm_GetMemoryUsage here -- if a memory region does not 
define a maximum size, then the total_max is not updated:
       if (u.max_size() == (size_t)-1) {
         has_undefined_max_size = true;
       if (!has_undefined_max_size) {
         total_max += u.max_size();

It started with JDK version 1.8.0-ea-b97.

In src/share/vm/services/management.cpp: jmm_GetMemoryUsage() there is 
next comment

// if any one of the memory pool has undefined init_size or max_size,
// set it to -1

But code doing this is missing, so I've added the code to do exactly 
what comment says.


More information about the hotspot-dev mailing list