RFR: 8011218 Kitchensink hanged, likely NMT is to blame

Zhengyu Gu zhengyu.gu at oracle.com
Thu Apr 18 05:43:59 PDT 2013


Dan,

Thanks for reviewing.

On 4/17/2013 9:10 PM, Daniel D. Daugherty wrote:
> On 4/17/13 3:33 PM, Zhengyu Gu wrote:
>> The thread that runs NMT query can be blocked on NMT snapshot lock, 
>> which prevents JVM to reach safepoints.
>>
>> NMT query does not change Java heap, it does not have to stop for 
>> safepoints. So the solution is to transition to _vm_in_native state, 
>> before executing NMT query.
>>
>>
>> JBS: https://jbs.oracle.com/bugs/browse/JDK-8011218
>> Public bug: not available
>> Webrev: http://cr.openjdk.java.net/~zgu/8011218/webrev.00/ 
>> <http://cr.openjdk.java.net/%7Ezgu/8011218/webrev.00/>
>
> src/share/vm/services/nmtDCmd.cpp
>     Since this function has a TRAPS parameter, you don't need to
>     fetch the current thread:
>
>     79   Thread* thr = Thread::current();
>     80   assert(thr->is_Java_thread(), "Must be a JavaThread");
>     81   assert(((JavaThread*)thr)->thread_state() == _thread_in_vm,
>     82     "Just check");
>
>     Delete line 79 and change 'thr' usage on lines 80-81 -> 'THREAD'.
>
I will fix this.

> 83   // Transition to _vm_in_native state, since NMT query does not touch
>     84   // Java heap.
>
>     The thread state is '_thread_in_native' not '_vm_in_native'. Also,
>     I think it is more than just not touching the Java heap. This 
> "JavaThread"
>     shouldn't be doing any "Java" operations, but I don't remember if we
>     have anything to enforce that.
>
I will fix the comment.

I don't think NMT query does any "Java" related operations. All it does 
is to lock NMT snapshot, then walk the data (may sort the data in 
different orders for detail queries) and print out the results.

Thanks,

-Zhengyu


> Dan
>
>
>>
>>
>> Test:
>>   - Run Kitchensink stress test on low power machine Linux x86 
>> machine with GC trace on, stress out NMT query thread by submitting 
>> NMT query in a loop, NMT query executions become very slow, but GC 
>> trace continues generating message, and does not show long pause.
>>
>> Thanks,
>>
>> -Zhengyu
>>
>>
>



More information about the hotspot-runtime-dev mailing list