Advanced Code Hot Swapping in JDK 8?

2019-01-21 16:55发布

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?

2条回答
太酷不给撩
2楼-- · 2019-01-21 17:23

JEPs coming in JDK 8 and JDK 9 are listed in this page. JEP-159 is not among them. From jep index you can see that JEP-159 is not yet targeted to any JDK release, not even jdk 10.

JEP-159 status is currently "Submitted". The process is described as follows:

A successful JEP passes through the following states:

  • Draft — In circulation by the author for initial review and consensus-building
  • Posted — Entered into the JEP Archive by the author for wider review
  • Submitted — Declared by the author to be ready for evaluation
  • Candidate — Accepted for inclusion in the Roadmap by the OpenJDK Lead
  • Funded — Judged by a Group or Area Lead to be fully funded
  • Completed — Finished and delivered

So it's not yet accepted for any roadmap.

查看更多
Fickle 薄情
3楼-- · 2019-01-21 17:39

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.

查看更多
登录 后发表回答