Dual JVM

From APIDesign

(Difference between revisions)
Jump to: navigation, search
Current revision (05:48, 2 May 2026) (edit) (undo)
 
(8 intermediate revisions not shown.)
Line 1: Line 1:
-
A heroic effort was needed to marry the fast start of the [[Enso]] engine (to be attributed to AOT compilation) with the need to dynamically load JVM classes. The effort is being called a ''"dual JVM"'' (see [https://docs.google.com/presentation/d/1f0ygesiiUbMe3rEXVonDPzLI0TyKIWkMeLyhh4okkKE slides]) because there are two [[Java]] virtual machines running in the single [[Enso]] process communicating effectively with each other.
+
A heroic effort was needed to marry the fast start of the [[Enso]] engine (to be attributed to [[AOT]] compilation) with the need to dynamically load [[JVM]] classes. The effort is being called a ''"dual JVM"'' (see [https://docs.google.com/presentation/d/1f0ygesiiUbMe3rEXVonDPzLI0TyKIWkMeLyhh4okkKE slides]) because there are two [[Java]] virtual machines running in the single [[Enso]] process communicating effectively with each other.
 +
The initial part of [[Java]] application is [[AOT]] compiled and as such it ''starts blazingly'' fast. At any time it can launch [[HotSpot]] [[JVM]] in the same process and run the remaining parts of the [[Java]] application ''more dynamically'' and [[JIT]] compile them.
-
=== [[Apache]] Arrow ===
+
The essential part of the [[Dual JVM]] system design includes an ''effective exchange'' of data between those two [[JVM]]s. The system allows '''zero copy''' exchange of data allocated as direct NIO {{JDK|java/nio|Buffer}}''s between those two [[JVM]]s.
-
 
+
-
The essential use-case was driven by the need to exchange columnar data between those two JVMs. We decided to support zero copy exchange of data (mostly) in the Apache Arrow format between those two JVMs. Performance seems to be sufficiently good and the format allows us to integrate with other Arrow-ready systems like Pandas when the time comes.
+
-
 
+
-
* Pros: similar system was an enterprise only feature called GraalVM Isolates
+
-
* Cons: the Isolates are being open sourced and further work may be needed to align with them
+

Current revision

A heroic effort was needed to marry the fast start of the Enso engine (to be attributed to AOT compilation) with the need to dynamically load JVM classes. The effort is being called a "dual JVM" (see slides) because there are two Java virtual machines running in the single Enso process communicating effectively with each other.

The initial part of Java application is AOT compiled and as such it starts blazingly fast. At any time it can launch HotSpot JVM in the same process and run the remaining parts of the Java application more dynamically and JIT compile them.

The essential part of the Dual JVM system design includes an effective exchange of data between those two JVMs. The system allows zero copy exchange of data allocated as direct NIO Buffers between those two JVMs.

Personal tools
buy