collect

external fun collect()(source)

Trigger new collection and wait for its completion.

Legacy MM: force garbage collection immediately, unless collector is stopped with stop operation. Even if GC is suspended, collect still triggers collection.

Since Kotlin

1.9