CAUTION: This site hosts draft documentation for the next release. For published content of the latest release, visit


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



Default behavior

The default value is 32.


A soft reference (where its referent is not marked) is cleared after a number of garbage collection cycles 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 garbage collection cycles.