views:

311

answers:

1

When running a Java 1.6 (1.6.0_03-b05) app I've added the -XX:+PrintCompilation flag. On the output for some methods, in particular some of those that I know are getting called a lot, I see the text made not entrant and made zombie.

What do these mean? Best guess is that it's a decompilation step before recompiling either that method or a dependency with greater optimisation. Is that true? Why "zombie" and "entrant"?

Example, with quite a bit of time between some of these lines:

[... near the beginning]
42       jsr166y.LinkedTransferQueue::xfer (294 bytes)

[... much later]
42    made not entrant  jsr166y.LinkedTransferQueue::xfer (294 bytes)
---   n   sun.misc.Unsafe::compareAndSwapObject
170       jsr166y.LinkedTransferQueue::xfer (294 bytes)
170   made not entrant  jsr166y.LinkedTransferQueue::xfer (294 bytes)
  4%      jsr166y.LinkedTransferQueue::xfer @ 29 (294 bytes)
171       jsr166y.LinkedTransferQueue::xfer (294 bytes)

[... even later]
42    made zombie  jsr166y.LinkedTransferQueue::xfer (294 bytes)
170   made zombie  jsr166y.LinkedTransferQueue::xfer (294 bytes)
171   made not entrant  jsr166y.LinkedTransferQueue::xfer (294 bytes)
172       jsr166y.LinkedTransferQueue::xfer (294 bytes)

[... no further logs]

Addition: some brief information explaining some of the symbols in that output. Also n means native.

+2  A: 

This is absolutely not an area of expertise for me, but I was interested and so did a bit of digging.

A couple of links you might find interesting: OpenJDK:nmethod.cpp, OpenJDK:nmethod.hpp.

A excerpt of nmethod.hpp:

// Make the nmethod non entrant. The nmethod will continue to be
// alive.  It is used when an uncommon trap happens.  Returns true
// if this thread changed the state of the nmethod or false if
// another thread performed the transition.
bool  make_not_entrant() { return make_not_entrant_or_zombie(not_entrant); }
//...

Just as a starting place.

Mark Peters
That's a useful start, thanks. The more I look into the code the more hotspot vocabulary I find I don't know! So do we think "not_entrant" simply means "don't execute this compiled code again, need to de-opt/recompile first"?Another link: see line 536 of http://www.google.com/codesearch/p?hl=en#aRIt9pqzOVI/src/share/vm/oops/methodOop.cpp
Joe Kearney
Given the meaning of "entrant" my *guess* would be that it flags the compiled method to not be *entered* again (though some threads may still be in it) while zombie means that it has no further use and can be disposed of. Just like a checkout counter could announce it's not accepting new customers (non-entrant) but would still have to service the queued customers before closing the till (zombie). But it's just a guess.
Mark Peters
Nice analogy :p
Joe Kearney