What is the HPROF file format?
Files with the .hprof extension hold heap memory dumps for programs running on the Java Virtual Machine (JVM). .hprof files are generated by the HPROF profiling agent built into the JDK. The format is binary and can grow very large - even several GB - proportional to the JVM heap size at the time of capture. As a diagnostic artifact, an .hprof file can be safely deleted without affecting application performance.
Generating .hprof files. .hprof files are typically generated during Java memory errors. The most common trigger is an OutOfMemoryError: adding the JVM flag -XX:+HeapDumpOnOutOfMemoryError causes the runtime to write a dump automatically on failure. Dumps can also be created on demand with jmap -dump:format=b,file=heap.hprof <pid> or jcmd <pid> GC.heap_dump. Memory dump files may also be created automatically upon abrupt JVM termination. Android devices also produce .hprof files, but in a slightly different internal format that requires conversion with hprof-conv before standard Java tools can read them.
Analyzing .hprof files - application memory issues. .hprof files can be analyzed with the Eclipse Memory Analyzer Tool (MAT), an open-source GUI application hosted by the Eclipse Foundation. MAT can import .hprof files and analyze them for OOM (Out of Memory) errors, identify memory leaks, and help optimize application memory usage. VisualVM, bundled with the JDK, is another widely used analyzer. For production-level profiling, JFR (Java Flight Recorder) is now the preferred approach from JDK 11 onward; HPROF heap dumps remain the standard tool for memory leak analysis.
Security & safety
RISK: MEDIUMHPROF files can contain sensitive data: passwords, private keys, API tokens, or personal information that was in JVM heap memory at dump time. Treat heap dumps as confidential; do not upload production dumps to online analysis services without reviewing or anonymising contents first. Files are not executable and pose no code-execution risk.
Format details
in a nutshell- Android ART Heap Dump - Android Runtime generates .hprof files with a compatible but not identical format; convert with hprof-conv (Android SDK) before opening in MAT/VisualVM.
Programs that open HPROF files
Technical details
deep spec| Encoding | Binary (primary); legacy ASCII text option also supported |
| Byte order | Big-endian |
| Container | Sequential HPROF binary record format |
| Magic string | "JAVA PROFILE 1.0.1" or "JAVA PROFILE 1.0.2" (null-terminated at offset 0) |
| Format version 1.0.1 | JDK 1.2-5; supports heaps up to 2 GB |
| Format version 1.0.2 | JDK 6+; adds HEAP DUMP SEGMENT tag (0x1C) for heaps over 2 GB |
| Typical file size | 50 MB - 20 GB (proportional to JVM heap at dump time) |
| Record structure | 1-byte tag + 4-byte timestamp offset + 4-byte body length + variable body |
| Key tags | HEAP DUMP (0x0C), HEAP DUMP SEGMENT (0x1C), UTF8 strings, LOAD CLASS records |
| Android HPROF | Uses .hprof extension but slightly different format; requires hprof-conv before analysis |
| Primary trigger | -XX:+HeapDumpOnOutOfMemoryError JVM flag; also jmap and jcmd on demand |
| Released | Java 1.2 (1998); binary format stabilised with JDK 1.6 |
| Latest version | HPROF binary format 1.0.2 (JDK 6+) |
| Specification | docs.oracle.com |
HPROF conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about HPROF files.