mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-15 08:34:30 +02:00
7182040: volano29 limited by os resource on Linux - need better diagnostic message
Changed message to "unable to create native thread: possibly out of memory or process/resource limits reached" Reviewed-by: dholmes, sla
This commit is contained in:
parent
dd25d6fed0
commit
7f138c5502
7 changed files with 16 additions and 7 deletions
|
@ -955,7 +955,7 @@ CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQue
|
|||
|
||||
if (compiler_thread == NULL || compiler_thread->osthread() == NULL){
|
||||
vm_exit_during_initialization("java.lang.OutOfMemoryError",
|
||||
"unable to create new native thread");
|
||||
os::native_thread_creation_failed_msg());
|
||||
}
|
||||
|
||||
java_lang_Thread::set_thread(thread_oop(), compiler_thread);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "runtime/interfaceSupport.hpp"
|
||||
#include "runtime/java.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
|
||||
// CopyrightVersion 1.2
|
||||
|
||||
|
@ -206,7 +207,7 @@ SurrogateLockerThread* SurrogateLockerThread::make(TRAPS) {
|
|||
// exceptions anyway, check and abort if this fails.
|
||||
if (res == NULL || res->osthread() == NULL) {
|
||||
vm_exit_during_initialization("java.lang.OutOfMemoryError",
|
||||
"unable to create new native thread");
|
||||
os::native_thread_creation_failed_msg());
|
||||
}
|
||||
java_lang_Thread::set_thread(thread_oop(), res);
|
||||
java_lang_Thread::set_priority(thread_oop(), NearMaxPriority);
|
||||
|
|
|
@ -2875,10 +2875,10 @@ JVM_ENTRY(void, JVM_StartThread(JNIEnv* env, jobject jthread))
|
|||
if (JvmtiExport::should_post_resource_exhausted()) {
|
||||
JvmtiExport::post_resource_exhausted(
|
||||
JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR | JVMTI_RESOURCE_EXHAUSTED_THREADS,
|
||||
"unable to create new native thread");
|
||||
os::native_thread_creation_failed_msg());
|
||||
}
|
||||
THROW_MSG(vmSymbols::java_lang_OutOfMemoryError(),
|
||||
"unable to create new native thread");
|
||||
os::native_thread_creation_failed_msg());
|
||||
}
|
||||
|
||||
Thread::start(native_thread);
|
||||
|
|
|
@ -362,7 +362,7 @@ void os::signal_init() {
|
|||
// exceptions anyway, check and abort if this fails.
|
||||
if (signal_thread == NULL || signal_thread->osthread() == NULL) {
|
||||
vm_exit_during_initialization("java.lang.OutOfMemoryError",
|
||||
"unable to create new native thread");
|
||||
os::native_thread_creation_failed_msg());
|
||||
}
|
||||
|
||||
java_lang_Thread::set_thread(thread_oop(), signal_thread);
|
||||
|
|
|
@ -805,6 +805,10 @@ class os: AllStatic {
|
|||
#endif
|
||||
#ifdef TARGET_OS_ARCH_bsd_zero
|
||||
# include "os_bsd_zero.hpp"
|
||||
#endif
|
||||
|
||||
#ifndef OS_NATIVE_THREAD_CREATION_FAILED_MSG
|
||||
#define OS_NATIVE_THREAD_CREATION_FAILED_MSG "unable to create native thread: possibly out of memory or process/resource limits reached"
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
@ -829,6 +833,9 @@ class os: AllStatic {
|
|||
// Hint to the underlying OS that a task switch would not be good.
|
||||
// Void return because it's a hint and can fail.
|
||||
static void hint_no_preempt();
|
||||
static const char* native_thread_creation_failed_msg() {
|
||||
return OS_NATIVE_THREAD_CREATION_FAILED_MSG;
|
||||
}
|
||||
|
||||
// Used at creation if requested by the diagnostic flag PauseAtStartup.
|
||||
// Causes the VM to wait until an external stimulus has been applied
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "runtime/javaCalls.hpp"
|
||||
#include "runtime/serviceThread.hpp"
|
||||
#include "runtime/mutexLocker.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "prims/jvmtiImpl.hpp"
|
||||
#include "services/gcNotifier.hpp"
|
||||
#include "services/diagnosticArgument.hpp"
|
||||
|
@ -66,7 +67,7 @@ void ServiceThread::initialize() {
|
|||
// exceptions anyway, check and abort if this fails.
|
||||
if (thread == NULL || thread->osthread() == NULL) {
|
||||
vm_exit_during_initialization("java.lang.OutOfMemoryError",
|
||||
"unable to create new native thread");
|
||||
os::native_thread_creation_failed_msg());
|
||||
}
|
||||
|
||||
java_lang_Thread::set_thread(thread_oop(), thread);
|
||||
|
|
|
@ -532,7 +532,7 @@ void AttachListener::init() {
|
|||
// Check that thread and osthread were created
|
||||
if (listener_thread == NULL || listener_thread->osthread() == NULL) {
|
||||
vm_exit_during_initialization("java.lang.OutOfMemoryError",
|
||||
"unable to create new native thread");
|
||||
os::native_thread_creation_failed_msg());
|
||||
}
|
||||
|
||||
java_lang_Thread::set_thread(thread_oop(), listener_thread);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue