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

JVM should use STACK_SIZE_PARAM_IS_A_RESERVATION when creating threads on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • hotspot
    • None
    • b51
    • x86
    • windows_xp

      If default stack size is not 0 or if user has specified stack size with -Xss,
      JVM will pass the stack size value through "stack_size" argument to
      _beginthreadex() when creating a new thread. However, on Windows "stack_size"
      refers to the initially committed space. It does not affect total (reserved)
      stack size at all if it's smaller than the default value specified in
      PE header. If the "stack_size" value is larger than default value, Windows will
      round up stack size to the nearest multiple of 1MB.

      Since b49 the default stack size in JVM has been changed to 320k, while the
      value in PE header remains 256k. This can cause OOM errors and/or performance
      degradation if the application has many threads, because each thread will
      take 1MB real memory.

      We should use STACK_SIZE_PARAM_IS_A_RESERVATION when creating new threads.

            hhuangsunw Hui Huang (Inactive)
            hhuangsunw Hui Huang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: