Skip to content

-Xsoftrefthreshold

Sets the value used by the garbage collector to determine the number of garbage collection (GC) cycles after which a soft reference is cleared if its referent has not been marked.

Syntax

    -Xsoftrefthreshold<value>

Default behavior

The default value is 32.

This option can be used with all Eclipse OpenJ9™ GC policies.

Explanation

A soft reference (where its referent is not marked) is cleared after a number of GC cycles, which is calculated as: <value> * (proportion of free heap space)

For example, if -Xsoftrefthreshold is set to 32, and the heap is 25% free, soft references are cleared after 8 GC cycles.