Java: Memory usage for types boolean and integer
807589Jan 8 2009 — edited Jan 15 2009Hi
I have built a map for a computer game. It has 800x800 squares on which one can build a town. I have stored data about each square in a 800x800 matrix of type integer. I would like to reduce the memory usage of the map. On idea i have is to replace the int matrix with a boolean matrix that would only contain information on which squares have a town.
I figure that this would save memory, since booleans only have two values (true false) while integers have many. Is this correct? And would it save a significant amount of memory?