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

Print more info when windows os::create_thread fails

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 17
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:

      Description

      To help diagnosing os::create_thread failures, in the following block of code, all information should be printed at the "warning" level.

      https://github.com/openjdk/jdk/blob/0d2f87e49401cc97ee095a836f4ca19741730b4f/src/hotspot/os/windows/os_windows.cpp#L771

          log_warning(os, thread)("Failed to start thread - _beginthreadex failed (%s) for attributes: %s.",
            os::errno_name(errno), describe_beginthreadex_attributes(buf, sizeof(buf), stack_size, initflag));
          // Log some OS information which might explain why creating the thread failed.
          log_info(os, thread)("Number of threads approx. running in the VM: %d", Threads::number_of_threads());
          LogStream st(Log(os, thread)::info());
          os::print_memory_info(&st);

      Such failures are rare, and usually people won't be running with -Xlog:thread, so the messages aren't available when they are needed the most.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: