--- old/src/hotspot/share/runtime/arguments.cpp 2017-10-11 14:34:53.769561442 -0400 +++ new/src/hotspot/share/runtime/arguments.cpp 2017-10-11 14:34:52.569493066 -0400 @@ -3354,12 +3354,6 @@ _exit_hook = CAST_TO_FN_PTR(exit_hook_t, option->extraInfo); } else if (match_option(option, "abort")) { _abort_hook = CAST_TO_FN_PTR(abort_hook_t, option->extraInfo); - // -XX:+AggressiveHeap - } else if (match_option(option, "-XX:+AggressiveHeap")) { - jint result = set_aggressive_heap_flags(); - if (result != JNI_OK) { - return result; - } // Need to keep consistency of MaxTenuringThreshold and AlwaysTenure/NeverTenure; // and the last option wins. } else if (match_option(option, "-XX:+NeverTenure")) { @@ -3641,6 +3635,18 @@ return JNI_ERR; } + // We need to know if we are running in a container + // to determine the active processor count and available + // memory. + os::initialize_container_support(); + + if (AggressiveHeap) { + jint result = set_aggressive_heap_flags(); + if (result != JNI_OK) { + return result; + } + } + // This must be done after all arguments have been processed. // java_compiler() true means set to "NONE" or empty. if (java_compiler() && !xdebug_mode()) {