Cc'd back to the list for further info as this might be useful to
others:

Paula Keohan wrote:

>     I can include this in my report for the project. Thanks for the figures!

Definitely. Just as some extra background information for you. The Java
Runtime by sun is *exceedingly* horrible in it's implementation of image
loading. For info, here are where copies of the memory is stored:

sun.awt.URLImageSource - 2 copies
com.sun.awt.Image = 1 copy  (IIRC, might be a different package name)
java.awt.Image 1 copy

You can reduce the amount of memory consumed down to 2 copies in memory
by calling flush() on the java.awt.Image object. However, the *stupid*
thing about the implementation is that as soon as you call
Image.getWidth() or getHeight() it will immediately load those two
copies back into memory again!!!!

And you know the dumb thing is that the Sun JDK engineers absolutely
refuse to acknowledge there is a problem here (have a look at any one of
the 10 or so bug reports on the JDC about this). The gaming community
has been vehemently bitching about this for the past 3 years at least
that I can remember. I can't see how the JavaGaming people are going to
have any success unless they deal with this highly critical problem
area.

At least Java3D has a potential way around this by allowing you to
provide a RenderedImage. Unfortunately, none of the current image code
deals with it. I do intend to update my ImageLoader code to generate
RenderedImages shortly for the Xj3D project, but that still requires
using a 3rd party library that uses native code (we had loading down to
one copy in memory plus about 20K of overhead per image - still sucks
for 64 pixel square textures, but better than the crap Sun puts out).

--
Justin Couch                         http://www.vlc.com.au/~justin/
Freelance Java Consultant                  http://www.yumetech.com/
Author, Java 3D FAQ Maintainer                  http://www.j3d.org/
-------------------------------------------------------------------
"Humanism is dead. Animals think, feel; so do machines now.
Neither man nor woman is the measure of all things. Every organism
processes data according to its domain, its environment; you, with
all your brains, would be useless in a mouse's universe..."
                                              - Greg Bear, Slant
-------------------------------------------------------------------

===========================================================================
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".

Reply via email to