Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BufferedImages not garbage collected -- any suggestions?




On 29 Mar 2006, at 19:27, Scott Palmer wrote:


On 29-Mar-06, at 1:00 PM, Jerry wrote:


On 29 Mar 2006, at 00:56, Greg Guerin wrote:


Apparently, the implementation of BufferedImage.flush() may vary.

There is more to BufferedImage than meets the eye and I'm not sure that looking at the source will help that much. Where possible, BufferedImages are mirrored in VRAM and the two copies have to be kept synchronized:

That is true for Windows and possibly Linux. Last I heard there were no accelerated images in the Mac implementation for Java 1.4 or Java 5. Though perhaps the color model is affecting this particular issue? Maybe if the image requires conversion to a Quartz compatible image format that converted image is cached and that is where the memory is leaking?

Experimentation shows that there is some acceleration (or deceleration) going on: take a BufferedImage, draw it to the screen a few hundred times. Now call getDataBuffer or setRGB once and watch the drawing speed plummet for ever after. I have a painting/image processing application and the entire code is warped around the fact that I have to do image processing without ever calling any of the methods which allow me to access a BufferedImage's pixels to avoid everything slowing down drastically. In fact, Windows is far better than the Mac in this regard (don't know about Linux) as the JVM does 'clever things' behind the scenes, but I've not been told what the clever things are and why they don't work on the Mac.


Jerry

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: BufferedImages not garbage collected -- any suggestions? (From: Greg Guerin <email@hidden>)
 >Re: BufferedImages not garbage collected -- any suggestions? (From: Jerry <email@hidden>)
 >Re: BufferedImages not garbage collected -- any suggestions? (From: Scott Palmer <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.