All Projects → agourlay → hprof-slurp

agourlay / hprof-slurp

Licence: Apache-2.0 license
JVM heap dump analyzer

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to hprof-slurp

styx
Programmable, asynchronous, event-based reverse proxy for JVM.
Stars: ✭ 250 (+284.62%)
Mutual labels:  jvm
aot
Russian morphology for Java
Stars: ✭ 41 (-36.92%)
Mutual labels:  jvm
whatsanalyze
Analyze your WhatsApp Chat in Seconds. Reveal insights & get statistics, while all data stays on your device. No chat data is sent to a server it runs only locally in your browser.
Stars: ✭ 41 (-36.92%)
Mutual labels:  analyzer
play-scala-compile-di-example
Example Play Project using compile time dependency injection and Play WS with ScalaTest
Stars: ✭ 37 (-43.08%)
Mutual labels:  jvm
play-java-chatroom-example
Example Chatroom with Java API
Stars: ✭ 33 (-49.23%)
Mutual labels:  jvm
jacobin
A more than minimal JVM written in Go and capable of running Java 17 classes.
Stars: ✭ 59 (-9.23%)
Mutual labels:  jvm
dragome-sdk
Dragome is a tool for creating client side web applications in pure Java (JVM) language.
Stars: ✭ 79 (+21.54%)
Mutual labels:  jvm
JavaHub
Java程序员学习之路,持续更新原创内容,欢迎Star
Stars: ✭ 27 (-58.46%)
Mutual labels:  jvm
mp4analyser
mp4 file analyser written in Python
Stars: ✭ 50 (-23.08%)
Mutual labels:  analyzer
java-manta
Java Manta Client SDK
Stars: ✭ 16 (-75.38%)
Mutual labels:  jvm
openwhisk-runtime-java
Apache OpenWhisk Runtime Java supports Apache OpenWhisk functions written in Java and other JVM-hosted languages
Stars: ✭ 43 (-33.85%)
Mutual labels:  jvm
Cojen
Java bytecode generation and disassembly tools
Stars: ✭ 28 (-56.92%)
Mutual labels:  jvm
discord
GitHub webhook that analyzes pull requests and adds comments about incompatible CSS
Stars: ✭ 29 (-55.38%)
Mutual labels:  analyzer
kotlin-guiced
Convenience Kotlin API over the Google Guice DI Library
Stars: ✭ 17 (-73.85%)
Mutual labels:  jvm
PerformanceAnalyzer
Under the iOS platform, the analyzer is a tool which statistics CPU, FPS, Memory, Loading-Time and provides the output of statistical data. And contain SQL execution time monitor base on FMDatabase and UI refresh in main thread monitor
Stars: ✭ 42 (-35.38%)
Mutual labels:  analyzer
java-perf-workshop
Guided walkthrough to understand the performance aspects of a Java web service
Stars: ✭ 53 (-18.46%)
Mutual labels:  jvm
WikiChron
Data visualization tool for wikis evolution
Stars: ✭ 19 (-70.77%)
Mutual labels:  analyzer
londogard-nlp-toolkit
Londogard Natural Language Processing Toolkit written in Kotlin
Stars: ✭ 49 (-24.62%)
Mutual labels:  jvm
auto-mat
A docker container to generate heap dump reports and indexes for eclipse MAT
Stars: ✭ 20 (-69.23%)
Mutual labels:  heap-dump
Cometary
Roslyn extensions, with a touch of meta-programming.
Stars: ✭ 31 (-52.31%)
Mutual labels:  analyzer

hprof-slurp

Build

hprof-slurp is a specialized JVM heap dump analyzer.

It is named after the hprof format which is used by the JDK to encode heap dumps.

The design of this tool is described in details in the following blog articles series.

Motivation

The underlying motivation is to enable the analysis of huge heap dumps which are much larger than the amount of RAM available on the host system.

hprof-slurp processes dump files in a streaming fashion in a single pass without storing intermediary results on the host.

This approach makes it possible to provide an extremely fast overview of dump files without the need to spin up expensive beefy instance.

However, it does not replace tools like Eclipse Mat and VisualVM which provide more advanced features at a different cost.

Features

  • displays top n allocated classes.
  • displays number of instances per class.
  • displays largest instance size per class.
  • display threads stack traces.
  • can list all Strings found.

Usage

./hprof-slurp --help
JVM heap dump hprof file analyzer

Usage: hprof-slurp [OPTIONS] --inputFile <inputFile>

Options:
  -i, --inputFile <inputFile>  binary hprof input file
  -t, --top <top>              the top results to display [default: 20]
  -d, --debug                  debug info
  -l, --listStrings            list all Strings found
  -h, --help                   Print help information
  -V, --version                Print version information

Example:

./hprof-slurp -i "test-heap-dumps/hprof-64.bin"
Found a total of 2.53MiB of instances allocated on the heap.

Top 20 allocated classes:

Total size | Instances |     Largest | Class name
----------------------------------------------------------------------------------
   1.99MiB |       436 |   634.78KiB | int[]
 197.11KiB |      1991 |    16.02KiB | char[]
  85.25KiB |       443 |     8.02KiB | byte[]
  47.38KiB |      1516 |  32.00bytes | java.lang.String
  45.42KiB |       560 |     8.02KiB | java.lang.Object[]
  15.26KiB |       126 | 124.00bytes | java.lang.reflect.Field
  14.77KiB |       378 |  40.00bytes | java.util.LinkedList$Node
   9.94KiB |       212 |  48.00bytes | java.util.HashMap$Node
   8.91KiB |       190 |  48.00bytes | java.util.LinkedList
   8.42KiB |        98 |  88.00bytes | java.lang.ref.SoftReference
   6.05KiB |       258 |  24.00bytes | java.lang.Integer
   5.91KiB |        18 |     2.02KiB | java.util.HashMap$Node[]
   5.86KiB |       150 |  40.00bytes | java.lang.StringBuilder
   5.44KiB |       116 |  48.00bytes | java.util.Hashtable$Entry
   5.05KiB |        38 | 136.00bytes | sun.util.locale.LocaleObjectCache$CacheEntry
   5.00KiB |        40 | 128.00bytes | java.lang.ref.Finalizer
   3.50KiB |        32 | 112.00bytes | java.net.URL
   3.42KiB |        73 |  48.00bytes | java.io.File
   3.17KiB |        12 | 776.00bytes | java.util.Hashtable$Entry[]
   3.13KiB |        56 | 144.00bytes | java.lang.String[]

Performance

On modern hardware hprof-slurp can process heap dump files at around 1GB/s.

To maximize performance make sure to run on a host with at least 4 cores.

Limitations

  • Tested only with JAVA PROFILE 1.0.2 & JAVA PROFILE 1.0.1 formats.
  • Does not support dumps generated by 32 bits JVM.

Generate a heap dump

Heap dump files are sometimes generated in case of a JVM crash depending on your runtime configuration.

It can also be done manually by triggering a heap dump using jmap.

Example:

jmap -dump:format=b,file=my-hprof-file.bin <pid>

Prior art of HPROF parsing

Several projects have been very useful while researching and implementing this tool. They have provided guidance and inspiration in moments of uncertainty.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].