The goal of this extension, jpf-jmt
, is to JPF is to provide memory limiting and more accurate reporting than the built-in ConsolePublisher
report. The ConsolePublisher
report indicates the maximum memory used by the application, however this is the maximum memory allowed by the JVM, not the actual maximum usage.
The jpf-jmt
extension provides the following main features:
- A state space graph listener which provides information about the memory usage of the application
- A search constraint which ensures the application does not exceed a certain limit of memory usage.
The state space listener is based on the StateSpaceDot
listener, with the following modifications:
- The label of each state is the current heap usage as of that moment in the application
- The label granularity may be set to one of:
B, KB, MB
The search property (a constraint), ensures that that the memory usage of the system under test does not exceed some limit. This limit may be set to any non-zero positive value. The limit may be set in the form of bytes, kilobytes, megabytes, gigabytes, or percentage. The percentage is given as a percent (e.g. 150
rather than 1.5
), and calculates the limit as a numeric value at startup. That is, if the heap usage at start is 10 MB
and the limit is set to 200
, the search property will be violated if the memory exceeds 20 MB
.
dist/
holds the packaged jar file upon build completion.lib/
contains the jar files required to compile the extension. These are the jar files from the JPF build.src/classes/
contains the compiled source files before being packagedsrc/examples/
contains the sample code which leveragesjmt
.src/main/jmt/listener/
contains theHeapListenerDot
listener, (as well as an internally used version ofStateSpaceDot
).src/main/jmt/util/
holds the extractedStateInformation
class fromStateSpaceDot
.src/main/jmt/vm/
is the location of theNotExceedMemory
search contraint.
Since the base JPF jar files ship with this extension, the only prerequisites are Java and Ant. To build, run ant
, which will compile the extension and package it into a JAR file in dist
folder.
Place the JAR in the same directory as RunJPF.jar
, jpf-classes.jar
and so on. Concatenate the included jpf.properties
in your local ~/.jpf/site.properties
file.
The following is the list of valid options and values (with defaults):
listener=jmt.listener.HeapListenerDot
: A custom listener which extendsgov.nasa.jpf.StateSpaceDot
by including memory usage information. Not enabled by default.jmt.report.memory_prefix=[B|KB|MB]
: Defines the unit type for the memory usage reported. Report values will be scaled according to this prefix. Defaults to kilobytes.search.properties=jmt.vm.NotExceedMemory
: A custom search constraint which ensures memory usage does not cross a given threshold. Not enabled by default.jmt.search.memory_units=[B|KB|MB|GB|%]
: Defines the unit type for the memory limit. Defaults to bytes.jmt.search.memory_limit=n
: Defines the limit for the memory usage of the system under test. Defaults to infinity (0
).
There are examples distributed in src/examples
.