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