Forum: Follow us on Twitter @heapSpank for notifications of new releases.

heapSpank detects Java memory leaks in minutes! Just download the jar and point to the process id (pid) of a running JVM that you want to monitor for leaks. *No heapdump required – it’s easy! Like this:

java -jar heapSpank-0.09.jar 8173

Using data from JAVA_HOME/bin/jmap -histo myPid, heapSpank shows the percentage of time that byte counts are on the rise for the 15 classes most likely to be leaking.

Classes that reach “100%” are the most likely to be leaky.

Quick Memory Leak Detection


  • For best results, warm up an application for a few minutes at ‘steady state’ before launching heapSpank.
  • Small leaks, as well as large ones, are identified.
  • MD5 (heapSpank-0.09.jar) = 54189f15017280ecf29116926e8593d2
  • Apache 2.0 license.
  • Do you know someone who has expertise with the IBM J9 JVM? Need help answering this question on so heapSpank can support the J9.


  1. Only works with HotSpot JVM, because data is furnished by HotSpot’s jmap -histo
  2. Curretly does not support jmap’s connection to remote JVMs….but please create an issue if that feature would be helpful.
  3. Does not detect metaspace/permgen leaks. For java 8+, use these instructions to look turn on verbose class loading and look for classes loading long after your JVM is warmed up – they are leaks.


  • Send your questions/feedback to for discussion.
  • Forum history available here.
  • To report a bug or ask for an enhancement open an issue here.


In case heapSpank is not quite what you were looking for, here are a few similar tools that do memory comparisons in search of memory leaks:

  • This python script compares two histogram (jmap -histo) runs.
  • This code uses aspectj to track instance counts on ever-growing java.util collections.
  • Many blogs/tools use heapDumps to diagnose memory leaks.
    • Open-source that auto-generates and auto-analyzes heap dumps, looking for leaks. Github site and this blog.
    • This blog recommends using JVisualVM to analyze a heapdump.
    • Eclipse MAT will compare two heap dumps as shown here.