You are currently viewing Is there a function to calculate a Kotlin’s object size in memory?

Is there a function to calculate a Kotlin’s object size in memory?

For context, I’m currently studying Android stuff and reading about savedInstanceState and Bundle, Android’s documentation says I should limit the size of data I send to a Bundle to less than 50kb.

Now I know I probably won’t exceed that and if I did by a small margin it’s probably no biggie, but I still got curious about knowing my parcelized objects’ sizes in memory. Curious how this is done in Kotlin.

submitted by /u/ED9898A
[link] [comments]