src/hotspot/os/solaris/os_solaris.cpp
changeset 54280 a33c42262338
parent 53646 043ae846819f
child 54825 1b03400e5a8f
--- a/src/hotspot/os/solaris/os_solaris.cpp	Tue Mar 26 07:24:26 2019 -0400
+++ b/src/hotspot/os/solaris/os_solaris.cpp	Fri Mar 22 04:47:02 2019 -0700
@@ -33,6 +33,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"
@@ -992,6 +993,11 @@
   } else {
     log_warning(os, thread)("Failed to start thread - thr_create failed (%s) for attributes: %s.",
       os::errno_name(status), describe_thr_create_attributes(buf, sizeof(buf), stack_size, flags));
+    // 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::Posix::print_rlimit_info(&st);
+    os::print_memory_info(&st);
   }
 
   if (status != 0) {