试图了解JVM的JIT行为

时间:2016-10-28 13:01:40

标签: java jvm jit

我正在使用-XX:+ PrintCompilation标志。现在,在紧密循环中运行相对复杂的操作大约3天,我已经完成了26K迭代,这些迭代都是相同的,但我仍然看到JIT正在发生:

135245570 11820       3       org.apache.xerces.impl.XMLDTDScannerImpl::setDTDHandler (6 bytes)   made zombie
135245571 12195       3       oracle.net.ano.AnoComm::i (11 bytes)
135245592 9715   !   4       org.springframework.jdbc.support.JdbcUtils::closeStatement (41 bytes)   made zombie
135245592 10054   !   3       com.google.common.cache.LocalCache$Segment::get (210 bytes)   made zombie
135245605 12196       3       oracle.jdbc.driver.T4CMAREngineStream::marshalB1Array (14 bytes)
136786126 12197   !   4       net.sf.log4jdbc.sql.jdbcapi.ConnectionSpy::prepareStatement (69 bytes)
136786158 9045   !   3       net.sf.log4jdbc.sql.jdbcapi.ConnectionSpy::prepareStatement (69 bytes)   made not entrant
137012330 12198   !   3       java.net.InetAddress::getAddressesFromNameService (245 bytes)
137012337 12201       3       java.net.URI$Parser::parse (265 bytes)
137012343 12203       3       java.net.URI::access$1002 (7 bytes)
137012344 11499       3       sun.nio.cs.US_ASCII$Decoder::decode (62 bytes)   made zombie
137012347 12202   !   3       java.net.URI$Parser::parseAuthority (256 bytes)
137012350 12199   !   3       java.net.InetAddress::checkLookupTable (99 bytes)
137012352 12200   !   3       java.net.InetAddress::cacheAddresses (52 bytes)
137045611 12204       4       java.util.concurrent.Executors$RunnableAdapter::call (14 bytes)
137045710 9432       3       java.util.concurrent.Executors$RunnableAdapter::call (14 bytes)   made not entrant
137048986 12205       3       oracle.jdbc.driver.T4CMAREngine::marshalKEYVAL (129 bytes)
137077651 12206   !   3       oracle.jdbc.driver.OracleCallableStatementWrapper::registerOutParameter (297 bytes)
137077666 12207   !   3       oracle.jdbc.driver.OracleCallableStatement::registerOutParameter (329 bytes)
138816046 12208       4       oracle.net.ano.AnoComm::a (34 bytes)
138816051 11867       3       oracle.net.ano.AnoComm::a (34 bytes)   made not entrant
138816051 10955       3       java.util.Hashtable$Enumerator::next (27 bytes)   made zombie
138884752 12209       3       java.net.AbstractPlainSocketImpl::finalize (5 bytes)

为什么会发生这种情况会有什么解释?

1 个答案:

答案 0 :(得分:0)

即使代码路径始终相同,并且Hotspot不太可能找到新的热点(这可能会触发jitted块的大量无效),它仍然可以使它已经为其设置的一些块无效其他原因。

这取决于如何实现此JIT引擎,查看那些made zombiemade not entrant,您显然会遇到一些特定条件,这些条件会使JIT生成的代码块无效并触发新的汇编