Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

swing VolatileImages memory leak when rotating device

815234May 21 2015 — edited May 21 2015

My app has the problem when rotating the device (auto adjustment of layout is done). Out of memory exception is thrown after c.a. 20 rotations.

Same problem found rotating the java jdk jvisualvm tool. After the investigation found that the problem is with Buffered Images and their dedicated Volatile Image.

/** * Maps from GraphicsConfiguration to VolatileImage. */ private Map<GraphicsConfiguration,VolatileImage> volatileMap = new HashMap<GraphicsConfiguration,VolatileImage>(1);

When I change the RepaintManager to use the volatileImageBufferEnabled=false the problem doesn't appear and no memory leak is not present.

I've read about scaling and images transformations during rotation is this responsible for that? or is it a bug in java?

Is there any way to avoid memory leak and use volatiles images?

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2015
Added on May 21 2015
0 comments
481 views