Skip to content

monoid/hprof_dump_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

79faa72 · Mar 20, 2025

History

43 Commits
Dec 3, 2019
Nov 26, 2019
Mar 20, 2025
Jul 31, 2020
Jun 13, 2020

Repository files navigation

OpenJDK HPROF dump parsing library.

Based on https://hg.openjdk.java.net/jdk/jdk/file/9a73a4e4011f/src/hotspot/share/services/heapDumper.cpp
and http://hg.openjdk.java.net/jdk6/jdk6/jdk/raw-file/tip/src/share/demo/jvmti/hprof/manual.html

Currently, the supported ID sizes (actually, pointer sizes) are 4 and 8.

The library provides a streaming interface (iterator over dump
records).  Class structure information and string dictionary are kept
in memory as they are required for unpacking object data.

There are two modes of operation: reading from std::io::BufRead with
StreamHprofReader::read_hprof_from_stream (strings are
returned as Vec<u8>) and from memory with
StreamHprofReader::read_hprof_from_memory (strings are returned as
&'memory [u8], where 'memory is memory lifetime).

Values stored in Record::String (i.e. strings by themselves) do not always
have valid UTF-8 data, that's why they are returned as byte vectors/slices.

Strings are returned as Record::String(id, data), and
from object dump, these strings are refered by their id; this
crate doesn't resolve these ids into strings (and objects are not
resolved either), you have to keep id->data mapping by yourself.

Author: Ivan Boldyrev <[email protected]>

About

Java HPROF memory dump parser written in Rust

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published