Configuration

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 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
    

Configuration Parameters

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

Advanced Configuration

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

Configuration File Precedence

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

  1. Java -D System Properties override all configuration.
  2. heapSpank.properties in same folder as heapSpank.jar
  3. heapSpank.properties in User's home dir.
  4. 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.

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.