By Erik Costlow-Oracle on Dec 18, 2014
Java Virtual Machine - More than just Java
The Java Platform offers a way to run different types of applications, even if those applications are not written in the Java programming language. As a result, developers can take advantage of optimizations and stability of the JVM, while system administrators can better control and monitor deployments.
Nashorn, The Hidden Weapon of JDK 8 was presented at the Silicon Valley Java User Group meeting in December 2014. The available slides describe the use of Nashorn and Avatar at Netflix and provide additional Nashorn demos.
Avoid rewrites and re-use libraries
Niko Köbler has a two-part article about Avatar 2.0 and its Model Store API. By using this model store API, developers can more easily interact with SQL and No-SQL and benefit from many existing optimizations.
- Part 1 explains the architecture and threading model.
- Part 2 covers the technology behind the Model Store API.
Monitoring Applications on the JVM
All Java processes can be monitored through a mechanism called JMX. System Administrators can enable remote authenticated JMX connections and see inside these running applications, rather than monitoring from the outside coming in.
Additional details about JMX monitoring (both local and remote) can be found in a previous post, Deep Monitoring with JMX.
Monitoring applications with Mission Control / Flight Recorder
Java Flight Recorder is an effective way of monitoring JVM applications in production. Unlike standard development profilers (like the NetBeans profiler), Flight Recorder has negligible performance impact.
The dashboard view in Mission Control provides basic information about CPU and memory resources. Developers may use the Threads tab to better understand system throughput, or if the application is blocking around any particular resources.
To open Mission Control, run the jmc command and connect to your Avatar application. The screenshot below shows Mission Control monitoring a Node.js application identified as com.oracle.avatar.Server.
Additional ways of running Node.js on the JVM
Avatar is one of several ways to run Node.js applications on the JVM.
- RedHat’s Nodyn project runs Node.js applications on the JVM and offers direct integration with the Vert.x framework.
- Apigee provides a Trireme and enables developers to embed a NodeEnvironment within their applications , which can then execute NodeScript objects.
When run on Oracle Java, both projects can be monitored by Flight Recorder / Mission Control as described above. Because this monitoring is provided directly by the Oracle JVM itself, there is no need to make any code changes or apply additional monitoring packages.