https://kotlinlang.org logo
Title
s

spierce7

02/01/2023, 5:16 AM
I was reading the roadmap and I saw this from KT-55512
• Google is working on a new memory allocator that should improve runtime performance as well as memory consumption. This important work also opens a path to further optimizations.
Google is implementing the memory allocator for Kotlin/native? I mean - if that's what's happening, that's awesome, I'm just trying to make sure I'm understanding this correctly.
l

Landry Norris

02/01/2023, 3:09 PM
I don’t think they’re creating it for Kotlin/Native. It sounds like Google is creating a new memory allocator and it can be used with K/N.
I’d like to find time to research the difference between tcmalloc and mimalloc to see what we’d be getting.
o

Oleg Yukhnevich

02/01/2023, 3:12 PM
You can grep kotlin repo for “custom” in K/N allocator specific code There’s already some progress there
Not sure thought, if it uses tcmalloc or not
l

Landry Norris

02/01/2023, 3:12 PM
I know they currently ship mimalloc as of 1.6.0, with the choice to allow the std (platform) allocator as a compiler flag.
s

sergey.bogolepov

02/01/2023, 3:27 PM
Folks from Google are working on a specialized allocator which is tightly integrated with Kotlin/Native runtime.
l

Landry Norris

02/01/2023, 3:28 PM
That’s cool. Is this separate from tcmalloc or an extension of it?
s

spierce7

02/01/2023, 3:28 PM
@sergey.bogolepov Hopefully this will make Kotlin Native's performance more similar to its comparable counterparts (i.e. Swift)
s

sergey.bogolepov

02/01/2023, 3:31 PM
AFAIK, it is not related to tc or any other malloc implementation.