RFR (XS) 7182040 - make native thread creation failure message more descriptive

Ioi Lam ioi.lam at oracle.com
Mon Feb 10 14:00:17 PST 2014


Please review a very small fix (JDK9):

http://cr.openjdk.java.net/~iklam/7182040/thread_create_failed_msg_001/

Bug: The original "OutOfMemorError" message could be misleading when the
      actual cause is the OS limit on number of processes/threads.

     https://bugs.openjdk.java.net/browse/JDK-7182040

Summary of fix:

     I changed all occurrence of the literal string "unable to create 
new native thread"
     in the C code to call a common function 
os::native_thread_creation_failed_msg().

     Individual OS ports may define an alternative message by defining the
     OS_NATIVE_THREAD_CREATION_FAILED_MSG macro in os_<port>.hpp

     Here's a snap shot of the new message:

     java.lang.OutOfMemoryError: unable to create native thread: 
possibly out of memory
                                 or process/resource limits reached
         at java.lang.Thread.start0(Native Method)
         at java.lang.Thread.start(Thread.java:713)
         at spin.main(spin.java:15)

Tests:

     JPRT

Thanks
- Ioi


More information about the hotspot-dev mailing list