# Uses of Class
java.lang.ref.Cleaner

Packages that use Cleaner
Package
Description
java.lang.ref
Provides reference-object classes, which support a limited degree of interaction with the garbage collector.
jdk.incubator.foreign
Classes to support low-level and efficient foreign memory/function access, directly from Java.

## Uses of Cleaner in java.lang.ref

Methods in java.lang.ref that return Cleaner
Modifier and Type
Method
Description
`static Cleaner`
Cleaner.`create()`
Returns a new `Cleaner`.
`static Cleaner`
Cleaner.`create​(ThreadFactory threadFactory)`
Returns a new `Cleaner` using a `Thread` from the `ThreadFactory`.

## Uses of Cleaner in jdk.incubator.foreign

Methods in jdk.incubator.foreign with parameters of type Cleaner
Modifier and Type
Method
Description
`MemorySegment`
MemorySegment.`registerCleaner​(Cleaner cleaner)`
Register this memory segment instance against a `Cleaner` object, by returning a new memory segment backed by the same underlying memory region as this segment.