Hi Kevin,

On 5/09/2012 8:35 AM, Kevin Walls wrote:
I'd like to get this reviewed, it's a deadlock that can happen due to
Java objects being allocated while holding Threads_lock.

We need to collect just the characters of the thread names while holding
the lock, and create the String objects when it's released. You do need
to hit the (non-public) HotspotInternal MBean very rapidly to trigger
this reliably, but there's a small chance the deadlock could happen when
it's called by the tool that is meant to call it.

http://cr.openjdk.java.net/~kevinw/7196045/webrev.01/

The only thing I don't like here is that the use of NEW_C_HEAP_ARRAY will cause an abort on out-of-memory and I'm not sure how big this array might be. If you are running out of C-Heap then you're on the edge of the cliff anyway and likely to fall at any minute, but I still dislike seeing more cases added to the code. I don't see an alternative though. :(

David


Thanks!
Kevin

Reply via email to