eostermueller edited this page Jan 7, 2017 · 13 revisions

heapSpank works out-of-the-box without any configuration on your part, but some parameters are available to speed up or slow down data collection and tweak other things, like # of rows in the UI.

To configure heapSpank, just create in the same folder as the heapSpank.jar file. There should be no need to change inside the heapSpank.jar, where all the default values are stored.

There are two other options for configuration:

  • Create in your home directory, like "C:\Users\Betty\" or "/Users/Betty/".

  • Pass in heapSpank parameters as java system -D parameters. This overrides all values in files. Example:

     java -Dorg.heapspank.jmap.histo.interval.seconds=30 -jar heapSpank-0.8.jar 8173

Configuration Parameters

Here are the various things you can configure (taken from here).

#The interval (in seconds) at which jmap -histo is invoked.

#If true, jmap -histo is passed the '-live' parameter, 
#which forces a full GC with every jmap -histo run.
#Using true will identify leak suspects more quickly & accurately, but will incur extra GC overhead.

#A 'window' is a group of jmap -histo 'runs', and this parameter defines the number of runs per window.
#A larger value (more runs per window) provides results with higher confidence.
#A smaller value provides results quicker.
#See com.github.eostermueller.heapspank.leakyspank.LeakySpankContext for how this is used.

#Count of the 'leakiest' classes promoted from each window 
#to an 'all time' list of leakest classes ever. 

#Count of rows in main display, 1 row per class.

#Any classes (ex: java.util.StringBuffer) that match this regex will never show up on heapSpank display.  


#not yet supported

#good for tinkering, providing pull requests.

Advanced Configuration

If the does not provide enough control for you, then just add your configuration in a subclass of DefaultConfig and pass the name of your subclass on the command line using the '-config' option. By default, jmap -histo is invoked every 5 seconds. The following slows this down to every 15 seconds.

java -jar heapSpank-0.8.jar 8173 -config com.github.eostermueller.heapspank.leakyspank.console.FifteenSecondJMapHistoInterval

Configuration File Precedence

The following shows the order of precedence of the 4 configuration options:

  1. Java -D System Properties override all configuration.
  2. in same folder as heapSpank.jar
  3. in User's home dir.
  4. file in heapSpank.jar file provides defaults for all variables.

As an example, a variable like "" in in same folder as heapSpank.jar will override the value of that same variable both in your in your home dir and in in the heapSpank.jar file.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.