public class SoftReference

  1. Object
  2. Reference
  3. SoftReference

A reference the collector keeps while the referent is being used and memory allows, and clears before the process runs out.

This directory is the SUPPORTED API SURFACE, not an implementation: maven/java-runtime compiles it and BytecodeComplianceMojo indexes the result as the set of types an application is allowed to touch. A class implemented in vm/JavaAPI but missing here is therefore invisible to user code – javac resolves it against the host JDK and the compliance check then rejects it as forbidden API, which is a confusing way to learn a feature was never exported. The bodies are deliberately inert for the same reason the neighbouring stubs are.

Constructors

public SoftReference(Object ref)Creates a new soft reference that refers to the given object.

Inherited methods

Constructor details

SoftReference

public SoftReference(Object ref)
Creates a new soft reference that refers to the given object.