Home  >  Q&A  >  body text

Why is Java not easy to hot deploy?

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?

扔个三星炸死你扔个三星炸死你2684 days ago844

reply all(3)I'll reply

  • 滿天的星座

    滿天的星座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.

    reply
    0
  • 学习ing

    学习ing2017-06-14 10:53:37

    Frequent compilation of virtual machines will occupy Jvm running memory, affect GC, and website performance will be reduced

    reply
    0
  • 某草草

    某草草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.

    reply
    0
  • Cancelreply