src/hotspot/os/windows/os_windows.cpp
changeset 54280 a33c42262338
parent 54031 feea57b38a1c
child 54485 ddc19ea5059c
--- a/src/hotspot/os/windows/os_windows.cpp	Tue Mar 26 07:24:26 2019 -0400
+++ b/src/hotspot/os/windows/os_windows.cpp	Fri Mar 22 04:47:02 2019 -0700
@@ -36,6 +36,7 @@
 #include "compiler/disassembler.hpp"
 #include "interpreter/interpreter.hpp"
 #include "logging/log.hpp"
+#include "logging/logStream.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/filemap.hpp"
 #include "oops/oop.inline.hpp"
@@ -669,6 +670,10 @@
   } else {
     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);
   }
 
   if (thread_handle == NULL) {