[messages] [Developers] determining how much heap a BufferedImage uses

uckelman uckelman at nomic.net
Mon Oct 4 03:45:02 MST 2010

I'm trying to determine how much heap I should expect a TYPE_INT_ARGB
BufferedImage with x pixels to use. I wrote a test program to find out,
which is posted here:

http://stackoverflow.com/questions/3854 ... data-array[1]

I'm curious if the results I found are consistent across JVMs and OSes.
Presently, I can't think of any good reason why a BufferedImage which
should have one int (4 bytes) per pixel would apparently need 6 bytes
per pixel. If an int[] really has 50% overhead, that's just

[1] http://stackoverflow.com/questions/3854200/why-does-a-bufferedimage-require-so-much-memory-beyond-the-size-of-its-data-array

Read this topic online here:

More information about the messages mailing list