On Wed, 21 Nov 2001, John Wright wrote: > Consider that a JPEG loads as a 32 bit image, thus 1024x1024 times 4 > bytes per pixel is 4 Meg of RAM. Usually the problems show up when you > try to slam a couple of these into a video card with only 16 Meg.
The problem is that this is _not_ the case, at least up to JDK1.3. Due to the poor implementation by the Sun engineers it keeps *four* copies in memory at 4 bytes per pixle. While you can call flush() to reduce that to two, as soon as you attempt to ask for anything like getHeight() it loads those two copies back into memory. If you want to load images efficiently, do not use any of the standard facilities and do it all yourself. (ie find a 3rd party library that does the image loading for you and doesn't use the AWT toolkit). -- Justin Couch http://www.vlc.com.au/~justin/ Freelance Java Consultant http://www.yumetech.com/ Author, Java 3D FAQ Maintainer http://www.j3d.org/ ------------------------------------------------------------------- "Look through the lens, and the light breaks down into many lights. Turn it or move it, and a new set of arrangements appears... is it a single light or many lights, lights that one must know how to distinguish, recognise and appreciate? Is it one light with many frames or one frame for many lights?" -Subcomandante Marcos ------------------------------------------------------------------- =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".