Pregunta

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?

¿Fue útil?

Solución

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).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top