Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8047998

Abort the vm if MaxNewSize is not the same as NewSize when MaxHeapSize is the same as InitialHeapSize

    XMLWordPrintable

Details

    • gc
    • b05

    Description

      The problem arises in Arguments::set_heap_size when ergonomically calculating the value for InitialHeapSize. A user might have specified a certain value for -XX:MaxHeapSize, for example 512m. If the machine has a lot of RAM, and InitialRAMFraction is unchanged, then:

        julong reasonable_initial = phys_mem / InitialRAMFraction;

      might become larger than MaxHeapSize. This will cause:

        reasonable_initial = MIN2(reasonable_initial, (julong)MaxHeapSize);

      to equal MaxHeapSize. This is not a huge problem until GenCollectorPolicy::initialize_size_info:

        if (_max_heap_byte_size == _initial_heap_byte_size) {
          // The maximum and initial heap sizes are the same so the generation's
          // initial size must be the same as it maximum size. Use NewSize as the
          // size if set on command line.
          _max_young_size = FLAG_IS_CMDLINE(NewSize) ? NewSize : _max_young_size;
          _initial_young_size = _max_young_size;

          // Also update the minimum size if min == initial == max.
          if (_max_heap_byte_size == _min_heap_byte_size) {
            _min_young_size = _max_young_size;
          }
        }

      This might cause an unexpected value for MaxNewSize.

      Attachments

        Issue Links

          Activity

            People

              gli Guoxiong Li
              ehelin Erik Helin
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: