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

NewSizeThreadIncrease would make an overflow

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • hotspot
    • None
    • gc
    • b105

      Codes using the flag NewSizeThreadIncrease (size_t) would face an overflow from below cases and we need some guard for that.
      As we calculates with non-daemon threads, flag validation will not work here.

      1. After multiplying non-daemon threads to NewSizeThreadIncrease.
      2. After an addition of desired new size and thread increase.
      3. After 'align_size_up'.

      DefNewGeneration::compute_new_size() {
      ...
        int threads_count = Threads::number_of_non_daemon_threads();
        size_t thread_increase_size = threads_count * NewSizeThreadIncrease;
        desired_new_size = align_size_up(desired_new_size + thread_increase_size, alignment);
      ...
      }

            sangheki Sangheon Kim
            sangheki Sangheon Kim
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: