--- a/src/hotspot/os/linux/os_linux.cpp Tue Mar 26 07:24:26 2019 -0400
+++ b/src/hotspot/os/linux/os_linux.cpp Fri Mar 22 04:47:02 2019 -0700
@@ -780,6 +780,13 @@
} else {
log_warning(os, thread)("Failed to start thread - pthread_create failed (%s) for attributes: %s.",
os::errno_name(ret), os::Posix::describe_pthread_attr(buf, sizeof(buf), &attr));
+ // 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);
+ os::Linux::print_proc_sys_info(&st);
+ os::Linux::print_container_info(&st);
}
pthread_attr_destroy(&attr);