Once I read the answer on internet (could be in Stack Overflow as well, I can't remember) showing all memory usage for each variable type in LibGdx , such as int, float, Boolean, and etc. however, I can't find it anymore. Can you please point me to that right direction?

In additional, as everyone suggested on the internet that memory usage should be kept to the minimal for Android apps, is there any way that I can use Small Int or Tiny Int (instead of of using int) since my variable are really small?

有帮助吗?

解决方案

To calculate the size of any object you can have a look at In Java, what is the best way to determine the size of an object?.

If you do not need a whole int (32 bit) you can use short (16 bit) or even byte (8 bit).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top