Dina Kleper
Dina Kleper

Reputation: 2061

Does Kotlin have a garbage collector? If so, on which algorithm is it based?

I'm doing a school project on Kotlin and need to know how it deals with garbage. Is it similar to Java in its garbage collector?

Upvotes: 13

Views: 9953

Answers (2)

voddan
voddan

Reputation: 33779

The garbage collector depends on the settings of your JVM runtime, not the language the program is written in (Jave, Kotlin, Groovy, Scala, Ceylon, etc)

Upvotes: 9

Krzysztof Krasoń
Krzysztof Krasoń

Reputation: 27476

Kotlin is run in JVM so it uses the same garbage collector as Java or any other JVM based language.

Upvotes: 26

Related Questions