I got it, and I would like to share my experience with however is
interested.  My problem was that I had a set of textures which I was
changing its images constantly during execution, but the way I was doing
it is by recregreating the buffered image, the writable rasterizer etc
etc etc and reapplying them to the textures.  My logic says, that this
would replace the previous things and the garbage collector would
release the resources.  But surprise! it did not so "Out of memory"
occurred.  But I noticed something strange, if I let the application
running without changing the textures after some time, I was able to
continue changing them but I had to stop and let the application "rest"
so I could continue changing the textures without running out of memory.
So I think there should be some low level thread that would be releasing
the resources and that it would only run only when there was nothing
else to process.  So, my second step was to explicitly invoke the
garbage collector, but another surprise, I still had to let the
application "rest" before continuing changing textures.  This makes me
think that the release of resources is happening some level in the
DirectX rather than in the virtual machine, or at least, there is no
synchronization of these releases and the application code (because of
the behavior explained above).  So, to solve my problem I kept a
reference to absolutely everything in the textures and modify their
contents without regenerating the textures and replacing them.  And it
works.

If anyone has any comments, feel free to tell them.



-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED] On Behalf Of Risto Rangel-Kuoppa
Sent: Wednesday, February 26, 2003 11:27 AM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Out of memory with textures

Hi! ... I am working with textures.  I change the pixels of the images
in the textures but after doing it several times an error arises stating
"Out of memory" ... How can this be happening if I always use the same
texture, and the bufferedImages I use always release any references once
I finish modifying the contents and reapplying them to the material.  Is
there some accumulative behavior in textures? ... Any idea would be very
useful :o)

Thanks in advance.

Risto.

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