# Effective Kotlin Item 47: Avoid unnecessary object creation

DevFeed: [Effective Kotlin Item 47: Avoid unnecessary object creation](<https://devfeed.tech/articles/effective-kotlin-item-47-avoid-unnecessary-object-creation-39293.md>)

Original publisher: [Read original article](<https://kt.academy/article/ek-unnecessary-objects>)

Published: 2021-08-22T00:00:00Z

Content type: article

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [performance-optimization](<https://devfeed.tech/topics/performance-optimization.md>), [object](<https://devfeed.tech/topics/object.md>), [Code](<https://devfeed.tech/topics/code.md>), [Cache](<https://devfeed.tech/topics/cache.md>)

Tags: [arrays](<https://devfeed.tech/tags/arrays.md>), [code](<https://devfeed.tech/tags/code.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [memory](<https://devfeed.tech/tags/memory.md>), [object](<https://devfeed.tech/tags/object.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [performance](<https://devfeed.tech/tags/performance.md>), [performance-optimization](<https://devfeed.tech/tags/performance-optimization.md>), [virtual-machine](<https://devfeed.tech/tags/virtual-machine.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

## AI overview

This Effective Kotlin item explains why unnecessary object creation can hurt performance on the JVM. It covers object reuse, boxing of primitives, memory overhead, references, and the additional access cost of encapsulated elements, especially for large collections and performance-critical processing.

## Source excerpt

About the most essential rule of performance optimization.