Repository navigation
Configuration
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 heapSpank.properties in the same folder as the heapSpank.jar file. There should be no need to change heapSpank.properties inside the heapSpank.jar, where all the default values are stored.
There are two other options for configuration:
-
Create heapSpank.properties in your home directory, like "C:\Users\Betty\heapSpank.properties" or "/Users/Betty/heapSpank.properties".
-
Pass in heapSpank parameters as java system -D parameters. This overrides all values in heapSpank.properties files. Example:
java -Dorg.heapspank.jmap.histo.interval.seconds=30 -jar heapSpank-0.8.jar 8173
Here are the various things you can configure (taken from here).
#The interval (in seconds) at which jmap -histo is invoked.
org.heapspank.jmap.histo.interval.seconds=5
#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.
org.heapspank.jmap.histo.live=false
#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.
org.heapspank.jmap.histo.count.per.window=4
#Count of the 'leakiest' classes promoted from each window
#to an 'all time' list of leakest classes ever.
org.heapspank.suspect.count.per.window=15
#Count of rows in main display, 1 row per class.
org.heapspank.display.row.count=15
#Any classes (ex: java.util.StringBuffer) that match this regex will never show up on heapSpank display.
org.heapspank.regex.exclusion.filter=
org.heapspank.screen.refresh.interval.seconds=1
#not yet supported
org.heapspank.max.iterations=86000
#good for tinkering, providing pull requests.
org.heapspank.view.class=com.github.eostermueller.heapspank.leakyspank.console.DefaultView
If the heapSpank.properties 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
The following shows the order of precedence of the 4 configuration options:
- Java -D System Properties override all configuration.
- heapSpank.properties in same folder as heapSpank.jar
- heapSpank.properties in User's home dir.
- heapSpank.properties file in heapSpank.jar file provides defaults for all variables.
As an example, a variable like "org.heapspank.jmap.histo.live=true" in heapSpank.properties in same folder as heapSpank.jar will override the value of that same variable both in your heapSpank.properties in your home dir and in heapSpank.properties in the heapSpank.jar file.