Skip to main content

Crate scrump_format_hprof

Crate scrump_format_hprof 

Source
Expand description

Java HPROF heap-dump handler.

HPROF format (per the Eclipse Memory Analyzer reference and the hprof_b_spec.h header that ships with the JDK):

File header (variable length, big-endian): - NUL-terminated ASCII format string, e.g. JAVA PROFILE 1.0.2 - u32 id_size (size of object IDs in bytes) - u32 timestamp_hi - u32 timestamp_lo

Repeated thereafter, one record per iteration (big-endian fields): - u8 tag - u32 ts_delta (micros since file start) - u32 length - u8[length] body

We emit each record body as a separate Chunk, with an appropriate origin label per known tag. Special-case tag 0x01 (UTF8 STRING) which has the layout id (id_size bytes) + utf8 string — we surface the utf8 portion as ChunkOrigin::StringTable("hprof.utf8") so the engine concentrates on what’s almost certainly a leak vector.

Redaction is byte-level zero-fill at absolute file offsets. The header, every record’s tag/length triplet, and the segment structure of HEAP DUMP SEGMENT records remain untouched — only payload bytes the engine flagged get zeroed. JVMs and analyzers tolerate that gracefully (zeroed string data renders as control characters, but the file remains structurally valid).

Structs§

Hprof

Functions§

handler