Using a Graph Database for JVM Heap Analysis

By James Richardson & Nat Pryce

Late in the development of a major new feature for one of the most widely used consumer products in the UK we encountered potentially show-stopping memory fragmentation issues. Our platform uses a proprietary embedded JVM that has limited diagnostic tooling. We therefore had to build our own tools under intense time pressure. We used an open source graph database (Neo4J) and its query language to rapidly build an ad-hoc analysis tool, and successfully used it to track down and eliminate the problematic code from our product. We will discuss some of the challenges we faced using Neo4J for interactive analysis of quite large data imports (80K nodes, 150k relationships) and how we overcame them. We will then demonstrate (with live-coding) some queries to show the audience surprising aspects of our code, platform and Oracle's Java compiler.

Many aspects of software can be modelled as graphs. Our experience shows that graph databases are a powerful foundation upon which to build software development tools. Thanks to increasing commoditization, we believe graph databases hold a lot of promise for non-mainstream programming platforms that are usually underserved by tool vendors.