JDK-6980206 : G1: assert(!has_undefined_max_size, "Undefined max size");
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs19
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-08-26
  • Updated: 2013-09-18
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u25Fixed 7Fixed hs20Fixed
Related Reports
Relates :  
Description
The changes for 6941275 (G1: The MemoryPools are incorrectly supported for G1) are tripping over an assert in management.cpp:

[2010-08-26T10:29:55.78] # Actual: /export/local/common/jdk/baseline/linux-i586/bin/java -client -Xmixed -XX:-PrintVMOptions -XX:+UseG1GC -XX:+StartAttachListener -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:-UseGCOverheadLimit vm.gc.containers.ContainersTest -ms low -ct LinkedHashMap(random(arrays))
[2010-08-26T10:29:55.78] # To suppress the following error report, specify this argument
[2010-08-26T10:29:56.94] # after -XX: or in .hotspotrc:  SuppressErrorAt=/management.cpp:791
[2010-08-26T10:29:56.94] #
[2010-08-26T10:29:56.94] # A fatal error has been detected by the Java Runtime Environment:
[2010-08-26T10:29:56.94] #
[2010-08-26T10:29:56.94] #  Internal Error (/tmp/jprt/P1/B/214611.jcoomes/source/src/share/vm/services/management.cpp:791), pid=23426, tid=3072813968
[2010-08-26T10:29:56.94] #  assert(!has_undefined_max_size) failed: Undefined max size
[2010-08-26T10:29:56.94] #
[2010-08-26T10:29:56.94] # JRE version: 7.0
[2010-08-26T10:29:56.94] # Java VM: OpenJDK Client VM (19.0-b06-201008252146.jcoomes.6978300-g1-gcthread-fastdebug mixed mode linux-x86 )
[2010-08-26T10:29:56.94] # An error report file with more information is saved as:
[2010-08-26T10:29:56.94] # /export/local/37621.JDK7.NIGHTLY.VM+linux-i586_vm_client_mixed_vm.gc.testlist/results/ResultDir/LinkedHashMap_Arrays/hs_err_pid23426.log
[2010-08-26T10:29:56.94] #
[2010-08-26T10:29:56.94] # If you would like to submit a bug report, please visit:
[2010-08-26T10:29:56.94] #   http://java.sun.com/webapps/bugreport/crash.jsp
[2010-08-26T10:29:56.94] #

It looks as if there are some assumptions in the management code that the max should be defined.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/1c63587d925b
28-08-2010

PUBLIC COMMENTS The assert failure happens in this method: // Returns a java/lang/management/MemoryUsage object representing // the memory usage for the heap or non-heap memory. JVM_ENTRY(jobject, jmm_GetMemoryUsage(JNIEnv* env, jboolean heap)) ResourceMark rm(THREAD); // Calculate the memory usage size_t total_init = 0; size_t total_used = 0; size_t total_committed = 0; size_t total_max = 0; bool has_undefined_init_size = false; bool has_undefined_max_size = false; for (int i = 0; i < MemoryService::num_memory_pools(); i++) { MemoryPool* pool = MemoryService::get_memory_pool(i); if ((heap && pool->is_heap()) || (!heap && pool->is_non_heap())) { MemoryUsage u = pool->get_memory_usage(); total_used += u.used(); total_committed += u.committed(); // if any one of the memory pool has undefined init_size or max_size, // set it to -1 if (u.init_size() == (size_t)-1) { has_undefined_init_size = true; } if (!has_undefined_init_size) { total_init += u.init_size(); } if (u.max_size() == (size_t)-1) { has_undefined_max_size = true; } if (!has_undefined_max_size) { total_max += u.max_size(); } } } // In our current implementation, all pools should have // defined init and max size assert(!has_undefined_init_size, "Undefined init size"); >>>> assert(!has_undefined_max_size, "Undefined max size"); <<<< MemoryUsage usage((heap ? InitialHeapSize : total_init), total_used, total_committed, (heap ? Universe::heap()->max_capacity() : total_max)); Handle obj = MemoryService::create_MemoryUsage_obj(usage, CHECK_NULL); return JNIHandles::make_local(env, obj()); JVM_END
26-08-2010

EVALUATION We thought that the easiest way to map G1's operation to the memory pool abstractions was to make the max size of each pool undefined by returning -1. It looks as if management.cpp assumes that this is not the case for our memory pools.
26-08-2010