Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java: Memory usage for types boolean and integer

807589Jan 8 2009 — edited Jan 15 2009
Hi
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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2009
Added on Jan 8 2009
13 comments
624 views