Dmitri Trembovetski wrote:

  Hi,

  for a VolatileImage flush() will release the associated vram
  immediately, so null-ing the reference would only help
  the GC to pick up the object.

  However, for BufferedImage flush() will release only the

  I should have said "managed image", since this applies to
  other types of images as well.

  Dmitri

  vram-cached copies of the image, and not the java heap-based
  data buffer, so in this case setting the reference to null
  will definitely help to release the data quicker and
  may in fact prevent OutOfMemoryErrors if you're allocating
  images in a loop.

  Thanks,
    Dmitri


[EMAIL PROTECTED] wrote:
Hi,

what is the best way to free accelerated memory?
I have several VolatileImage objects at the same time. When I don't need one of them anymore, I want it to be off the accelerated memory as fast as possible because I need the memory for an other image.

Is it enough to do something like this (if "image" is a VolatileImage object):

image = null;

Or is it better to call this (or does it make a difference, at all?):

image.flush(); image = null;

After the call "image=null;" is the accelerated memory freed immediately or will it not be frred until the garbage collector finally destroys my image object?

Are there any other possiblilities to free accelerated memory the fast way? I hope you got some good hints for me concerning this problem because accelerated memory on my system is very rare.

Thanks,
Maik
[Message sent by forum member 'kiamur' (kiamur)]

http://forums.java.net/jive/thread.jspa?messageID=296688

=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-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 JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to