I am writing an application and I need to display a lot (10000+) of graphical components (JLabel's with icons). I may have to display them all at the same time in JScrollPanes.
Is there a way for me to calculate how much memory will this take?
I know that each object itself in memory occupies X bytes, but I would like to know how much more does the graphical representation take. Lets assume my icons are 100x100 pixels at 16 million colors each (worst case scenario).
How could I achieve an approximate value of the memory occupied by the graphical representation?
Thanks a million.
Sun Certified Programmer for the Java 2 Platform 1.4<p>If I can create, I will make mistakes. If I can learn with them, it must be some kind of art.
Assuming that there is no compression in the imager (worst case) and that you are including the alpha channel in the calculations, each pixel would take 4 bytes (8 bits each for red, green, blue and alpha). this would bring the grand total for your size of icon to 40,000. I would then add 10% to this just to be on the safe side.
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
how do I do my own kindle-like thing - without amazon