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

Print more info when windows os::create_thread fails

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 17
    • hotspot

      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.

            Unassigned Unassigned
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: