My question is
I modify the java code, and then the page requests execution, and the server automatically compiles it into bytecode and sends it to the jvm for running. Why do we need to restart the jvm to execute the modified code?
滿天的星座2017-06-14 10:53:37
Java has many hot deployment solutions. https://www.google.com/search...
But hot deployment will affect performance, and in a production environment, the frequency of Java code deployment is very low.
So, hot deployment is generally enabled in the development environment.
学习ing2017-06-14 10:53:37
Frequent compilation of virtual machines will occupy Jvm running memory, affect GC, and website performance will be reduced
某草草2017-06-14 10:53:37
The essence of hot deployment is to replace the class, which means that the old class needs to be kicked out of the memory and the new class reloaded. This involves unloading the class, and one of the conditions for unloading a class is that its ClassLoader can Picked up by the garbage collection. On the other hand, if the ClassLoader cannot be recycled, then java can only be restarted.