I am pretty sure that solutions for java will not work on kotlin native as those are completely different runtime environments.
I`m not sure why your error is talking about a VM but I think I understand the error. A 32bit System can only use about 4GB of memory as that is all that can be addressed by a 32bit pointer. It’s actually a bit less. It’s more like 3.5GB and than this memory has to be shared by the operating system and the user. So without some tricks your application should only be able to use about 2GB of memory at any given point (Don’t quote me on those numbers). You are trying to use about 3.
So what can you do. I guess you don’t have the option to just switch to a 64bit System so you will either have to implement a system which uses less memory or you have to look into some caching algorithms. Also there some of the solutions might not be possible due to the early stage of Kotlin native. I am not sure how much influence you have over memory allocation and how efficient Kotlin is behind the hood.