Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Advanced Code Hot Swapping in JDK 8?

I am looking for better HotSwapping in the JavaVM. Being able to only apply method body changes is okay but quite limiting.

The options available is JRebel and a discontinued project called Dynamic Code Evolution Virtual Machine (DCEVM).

There is a JEP 159 out there that was written by the core developper of DCEVM. A blog post from 2011 mentioned that the developers of DCEVM now work for Oracle to integrate this into the JDK.

Do we have this kind of support for JDK 8 beta already or was it postponed to JDK 9?

I need hot swapping for adding and removing and renaming private methods mostly. This would help alot. Is there a product allowing me to do so (beside JRebel which PR-campaigns got me upset).

The last supported version of DCEVM is for 1.6u24 and it only provides 32-bit linux binaries. Since I use 1.7 and 64bit Linux this is both a show stopper for me.

There is also another project available on github called Fakereplace. Can this be easily used for my purpose or should I not investigate into this?

like image 348
Martin Kersten Avatar asked Nov 28 '13 09:11

Martin Kersten


People also ask

What is hot swapping in Java?

Java IDEs and VMs support a feature called HotSwapping. It allows you to update the version of a class while the virtual machine is running, without needing to redeploy the webapp, restart, or otherwise interrupt your debugging session. It's a huge productivity boost if you're editing the body of a method.

What is hot swapping code?

Hot code swapping is replacing or adding components without stopping or shutting down the system. It is frequently called as hot plugging. In software development, hot swapping is used to upgrade or update the system without interrupting the current running system.


1 Answers

There is a fork of DCEVM maintained in the repository on Github. It was recently updated for Java 8. The binaries are available through the GitHub releases or on the downloads page.

For simple things, like adding/removing methods, it should be pretty reliable (verified by automated tests in 16 different configurations). However, it still could eventually crash JVM, so it is by no means should be used in production.

like image 76
Ivan Dubrov Avatar answered Oct 04 '22 20:10

Ivan Dubrov