← Docs
kotlin-stdlib / kotlin.native.runtime / GC / collect

collect

Native
1.3
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.

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .