Image Memory, Image Buffer - flush and dispose
i've been trying for a while but I can't find a way to dispose my image buffer to be able to use more than these 12 MPixel per project.
My starting point is HD Cookbook and the additional info on the cookbook site: http://wiki.java.net/bin/view/Mobileandembedded/BDJImageMemoryManagement
I'd be happy about any hints or test results.
- When I call .flush() on an Image (I also set it to null and called System.gc() ) the Memory for this Image should be freed. Right?
- When I create a Full Screen DVBBufferedImage it takes up the same space as an ordinary Full Screen Image - no matter how much I paint into its Graphics Object. I can free it using the dispose() Method - but as long as I want to paint I don't have to. Right?
I did some testing, but the results don't make me see clearer. Can anyone explain what's going on here? I'm loading one image after another with a few Seconds sleep() between and a repaint to see if it was loaded successfully.
1. No double Buffering, no flush:
Everything as it should be. All Players load as many Images as they should depending on Profile.
2. Double Buffering, no flush:
Everything as it should be. All players load 1 Image less that before, because of Full Screen BufferedImage
3. No Double Buffering, flush called before loading next Image:
PS3 loads ALL my images as it should - all other players react like there was no flush.
4. Double Buffering, flush called before loading next Image:
All Players act like there was no flush (Also PS3)
Isn't that strange? Especially the PS3! Am I missing anything?
I even tried to dispose and create an new DVBBufferedImage at every repaint.
Thanks a lot! This is making me crazy...
Additional questions just for fun :)
The property telling me the image memory size didn't work on my players - has anyone seen it work on any player? (winDVD works)
Can I read the actual memory usage?
When I create an Image - is there a way to find out when it couldn't be loaded due to full Image Memory?
btw. Tested on several Sony, Panasonic and Denon players.