Hacker News new | ask | show | jobs
by moomba 5822 days ago
Yea, Strings in Java take up much more memory than one would expect.

Minimum String memory usage (bytes) = 8 * (int) ((((no chars) * 2) + 45) / 8)

http://www.javamex.com/tutorials/memory/string_memory_usage....

Objects in general also have significant overhead.