The heap snapshot binary format (a.k.a hprof binary format) is described at
Essential idea of jhat/OQL is this: heap snapshot is a database of objects. jhat parses the dump, creates in-memory object model, interprets query and generates result HTML.
How about this? - a new command line utility to "import" heap dump files into a database like Java DB. Then, we can use SQL to query the database - and it would be very easy to write tools on top of JDBC/SQL access. Besides, we can take advantage of the "large file" handling, indexing, query optimization aspects of the database - rather than having to implement similar stuff by jhat. Or may be, we can reimplement jhat as a tool that