Paul Krill
Editor at Large

Kotlin update shines on garbage collector

news
Aug 27, 20242 mins

Kotlin 2.0.20 should significantly shorten garbage collection pause time and help improve application responsiveness, JetBrains said.

Mobile app developer showing test version of product to team lead
Credit: Dragon Images / Shutterstock

JetBrains has released an update to the Kotlin programming language. Kotlin 2.0.20 features concurrent marking for the garbage collector and other performance improvements, along with bug fixes for Kotlin 2.0.0.

Unveiled August 22, Kotlin 2.0.20 follows the May 23 release of Kotlin 2.0.0. Installation instructions for Kotlin 2.0.20 can be found at jetbrains.com.  

With the Kotlin 2.0.20 release, experimental support for concurrent marking for Kotlin/Native has been added to the garbage collector (GC). By default, application threads were paused when the GC marks objects in the heap. Now the marking phase of the GC can be run simultaneously with application threads, which should significantly shorten the GC pause time and help improve application responsiveness, JetBrains said. Kotlin/Native enables compiling Kotlin code to native binaries.

Kotlin 2.0.20 begins a change to the data class copy function. Currently, when you create a data class using a private constructor, the automatically generated .copy() function doesn’t provide the same visibility. In future Kotlin releases, the default visibility of the .copy() function will be the same as the constructor. Kotlin 2.2.20 starts this migration plan by issuing warnings in code where the visibility will change in the future.

Additionally, Kotlin 2.0.20 adds support for Gradle versions 8.6 to 8.8, and introduces a new option for sharing JVM artifacts between Gradle projects as class files.

For Kotlin Multiplatform development, Kotlin 2.0.20 offers improvements to source set management in multiplatform projects along with deprecation of compatibility with some Gradle plugins due to recent changes in Gradle.

The Kotlin plugins that support Kotlin 2.0.20 are bundled in the latest IntelliJ Idea and Android Studio IDEs. Developers do not need to update the Kotlin plugin in their IDEs.

With Kotlin 2.0.0, JetBrains unveiled a Stable release of the Kotlin K2 compiler, for better performance, and introduced an open-source Kotlin data set for large language model (LLM) builders. Support for named exports in Kotlin/Wasm also was featured.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author