Why does the JVM require warmup?
<p>I understand that in the Java virtual machine (JVM), warmup is potentially required as Java loads classes using a lazy loading process and as such you want to ensure that the objects are initialized before you start the main transactions. I am a C++ developer and have not had to deal with similar requirements.</p>

<p>However, the parts I am not able to understand are the following:</p>

<ol>
<li>Which parts of the code should you warm up? </li>
<li>Even if I warm up some parts of the code, how long does it remain warm (assuming this term only means how long your class objects remain in-memory)? </li>
<li>How does it help if I have objects which need to be created each time I receive an event?</li>
</ol>

<p>Consider for an example an application that is expected to receive messages over a socket and the transactions could be New Order, Modify Order and Cancel Order or transaction confirmed.</p>

<p>Note that the application is about High Frequency Trading (HFT) so performance is of extreme importance.</p>