There are several caches in the system. For example, if you load gif, jpeg
or png textures using TextureLoader, that one is delegating to
java.awt.Toolkit to load and decode the images. That's why the TextureLoader
accepts only filenames as strings or url's, to match the Toolkit api (it's
quite annoing that you cannot pass an input stream!). The Toolkit in turn
caches staticaly the images so what ever you do to the universe or with the
garbage collector is not influencing it. That's about textures.

However, I'm seeing also memory leaks, but unfortunately, at the moment I'm
not in the state to investigate them.

Cheers,

Florin

-----Urspr�ngliche Nachricht-----
Von: Giuseppe Fontana [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 20. Februar 2003 21:34
An: [EMAIL PROTECTED]
Betreff: Re: [JAVA3D] Java3D & Garbage Collection


Thank you all for the assistance!
I executed the environment using:
" java -Xrunhprof:heap=all,file= etc... myClass"
If I'm not wrong  I guess the problem is about a lot of retained image
objects.
The largest is generated at trace 14522 by java3D texture loader, into the
process stimulus of a Behavior that I use to change
some textures.
It looks like entire [B image arrays  are still "live" at the end of the
program, even if I call myuniverse....removeAllLocales!
I included some parts of the output file. The "incriminated" trace is, of
course, 14522.

****************************************************************************
********
(.....)
TRACE 14522:
javax.media.j3d.ImageComponent2DRetained.set(ImageComponent2DRetained.java:8
0)
javax.media.j3d.ImageComponent2D.<init>(ImageComponent2D.java:168)
com.sun.j3d.utils.image.TextureLoader.getTexture(TextureLoader.java:613)
myBehavior.processStimulus(AnimateBehavior.java:217)
javax.media.j3d.BehaviorScheduler.doWork(BehaviorScheduler.java:172)

(.......)
ARR f7ac328 (sz=524304, trace=14522, nelems=524288, elem type=byte)


(........)
SITES BEGIN (ordered by live bytes)
Thu Feb 20 11:04:04 2003
          percent         live       alloc'ed  stack        class

 rank   self         accum    bytes       objs    bytes   objs    trace
name
 1        27.91%   27.91%  7864560   15  7864560     15      14522  [B

(..............)
****************************************************************************
****
What do you think about these?
Is TextureLoader retaining memory or what?
And, by the way, is it there a way to bypass TextureLoader utility to load
JPG textures?

Is it possible to:
1. Load a Buffered Image using ImageIO
2. Copy it into an ImageComponent2D
3. Create a Texture2D with the ImageComponent2D
4. Load the Texture into an Appearance
?

As far as I know it is not!
Texture2D setImage(.....) method is intented to load "mipmap" images, with
fixed ( power of 2) height anf width, and is not useful.
Anyone can help?
Thanks,
Giuseppe

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

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