JDK-8031493 : nsk/jvmti/unit/heap/ObjectFreeTests fails at JVM initialization with java.lang.OutOfMemoryError: unable to create new native thread
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • Submitted: 2014-01-10
  • Updated: 2014-04-17
  • Resolved: 2014-01-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Related Reports
Relates :  
Description
Test nsk/jvmti/unit/heap/ObjectFreeTests failed during initialization with java.lang.OutOfMemory

# Actual: /export/local/aurora/sandbox/sca/vmsqe/jdk/nightly/fastdebug/rt_baseline/linux-amd64//bin/java -d64 -server -Xcomp -XX:MaxRAMFraction=8 -XX:+CreateMinidumpOnCrash -XX:NativeMemoryTracking=detail -XX:ReservedCodeCacheSize=256M -agentlib:Heap=-waittime=5 nsk.jvmti.unit.heap.ObjectFreeTests
Error occurred during initialization of VM
java.lang.OutOfMemoryError: unable to create new native thread

Test run URL: http://aurora.ru.oracle.com/functional/faces/RunDetails.xhtml?names=343805.JAVASE.NIGHTLY.VM.RT_Baseline.2014-01-09-31&show-limit=0&filter=
Host: scaaa569, Intel Xeon 2901 MHz, 32 cores, 252G, Linux / Oracle Linux 6.3, x86_64
Options: -server -Xcomp -XX:MaxRAMFraction=8 -XX:+CreateMinidumpOnCrash -XX:NativeMemoryTracking=detail -XX:ReservedCodeCacheSize=256M

Comments
There is already a bug to add more information in the exception message "unable to create native thread"
14-01-2014

Make sense to close as duplicate. Just to make it clear on enhancing the error message: For example, on Linux, there are a couple of places that os::create_thread() can fail: 1. Can not create OSThread object - definitely out of memory 2. pthread_create() fails - unable to create native thread. Unfortunately, os::create_thread() returns boolean ...
14-01-2014

I think it is pretty clear that the underlying issue has to be dealt with as an infrastructure fix via INTJDK-7601511. If VM/SQE nightly is going to execute tests in parallel, then the test machines need to be properly configured to do that job without these artificial failures. In reply to this part: > except improving error reporting, to distinguish the error is due to not be able to > create OS native, or run out of memory while creating Thread related objects. In the description section, the error message is shown as: > Error occurred during initialization of VM > java.lang.OutOfMemoryError: unable to create new native thread That seems like a pretty clear error message to me, but maybe I'm missing something. I think this bug should be closed as a duplicate of INTJDK-7601511.
14-01-2014

There are a few similar instances (some without NMT) http://aurora.ru.oracle.com/functional/faces/RunDetails.xhtml?names=305571.JAVASE.NIGHTLY.VM.Comp_Baseline-Tiered-Stable.2013-10-16-24#nsk.jvmti%20%5B(quick)&&(!desktop)%5D%20(tonga)_nsk/jvmti/unit/heap/ObjectFreeTests http://aurora.ru.oracle.com/functional/faces/RunDetails.xhtml?names=324395.JAVASE.NIGHTLY.VM.Emb_Baseline-std.2013-11-27-27#nsk.jvmti%20%5B!desktop%5D%20(tonga)_nsk/jvmti/unit/heap/ObjectFreeTests
14-01-2014

You are right, my query was wrong. I don't think there is anything we can do here, except improving error reporting, to distinguish the error is due to not be able to create OS native, or run out of memory while creating Thread related objects.
14-01-2014

Not sure why you are showing 'ulimit -Hn' output. That has to do with the open files limit and not the limit on processes/threads. The gtee user is limited to 1024 processes and threads at any one time. When running a test suite in parallel, it takes just a few tests that launch a bunch of threads each to reach this limit. The interest point about this limit: - have three tests that launch 330 threads each for 990 threads - have one test that launches ~10 threads You can see a thread create failure in the ~10 thread test and it makes no sense because that test only creates ~10 threads...
14-01-2014

I don't think it is process limitations, since JVM is already running but unable to create thread. -bash-4.1$ ulimit -Hn 8192
14-01-2014

Based on this information for the original test machine: -bash-4.1$ hostname scaaa569 -bash-4.1$ ulimit -u 1024 This appears to be an instance of the following known issue: INTJDK-7601511 Process limitations on high concurrency
14-01-2014

I could not reproduce on busgt0817 with 10000 iterations. I believe it was not due to lack of memory, but the system running out of thread resource, that particular system has 8K thread limit.
14-01-2014

RULE nsk/jvmti/unit/heap/ObjectFreeTests Exception java.lang.OutOfMemoryError: unable to create new native thread RULE nsk/jvmti/unit/heap/ObjectFreeTests ExitCode 1
10-01-2014

My first instinct was to move this bug from hotspot/runtime -> hotspot/jvmti since this is a JVM/TI test. However, the use of "-XX:NativeMemoryTracking=detail" in this test run means there might be an NMT issue.
10-01-2014