Weak and soft references.

Weak references don’t protect the referenced object from getting collected by a garbage collector. Soft references are like weak ones, but they allow the referenced object to be cleared only when memory is running low.

soft

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (soft x)

  • (soft x ch)

Type signatures:
  • (Any) → IReference

  • (Any ⨯ ITargetPort) → IReference

Returns a soft reference to x. If ch is specified, puts reference into ch when enqueued by host.

weak

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (weak x)

  • (weak x ch)

Type signatures:
  • (Any) → IReference

  • (Any ⨯ ITargetPort) → IReference

Returns a weak reference to x. If ch is specified, puts reference into ch when enqueued by host.