Java Reference
In-Depth Information
Concurrent classloading
The class was modified as it was being compiled. The JVM will compile it again later;
you should expect to see the method recompiled later in the log.
In all cases (except the cache being filled), the compilation should be reattempted again. If it
is not, then there is an error that prevents compilation of the code. This is often a bug in the
compiler, but the usual remedy in all cases is to refactor the code into something simpler that
the compiler can handle.
Here are a few lines of output from enabling PrintCompilation on the stock servlet web
28015 850 net.sdo.StockPrice::getClosingPrice (5 bytes)
28179 905 s net.sdo.StockPriceHistoryImpl::process (248 bytes)
28226 25 % net.sdo.StockPriceHistoryImpl::<init> @ 48 (156 bytes)
28244 935 net.sdo.MockStockPriceEntityManagerFactory$\
MockStockPriceEntityManager::find (507 bytes)
29929 939 net.sdo.StockPriceHistoryImpl::<init> (156 bytes)
106805 1568 ! net.sdo.StockServlet::processRequest (197 bytes)
This output includes only a few of the stock-related methods that have been compiled. A few
interesting things to note: the first such method wasn't compiled until 28 seconds after the
application server was started, and 849 methods were compiled before it. In this case, all
those other methods were methods of the application server (filtered out of this output). The
application server took about 2 seconds to start; the remaining 26 seconds before anything
else was compiled were essentially idle as the application server waited for requests.
The remaining lines are included to point out some interesting features. The process()
method, as seen here and in the code listing, is synchronized. Inner classes are compiled just
like any other class and appear in the output with the usual Java nomenclature: outer-
classname$inner-classname . The processRequest() method shows up with the excep-
tion handler as expected.
Finally, recall the implementation of the StockPriceHistoryImpl constructor, which con-
tains a large loop:
public StockPriceHistoryImpl ( String s , Date startDate , Date endDate ) {
EntityManager em = emf . createEntityManager ();
Date curDate = new
new Date ( startDate . getTime ());
symbol = s ;
Search WWH ::

Custom Search