[OpenJDK Rasterizer] Fwd: sun.java2D.pisces big memory usage (waste ?)

Laurent Bourgès bourges.laurent at gmail.com
Fri Mar 22 04:35:34 PDT 2013


Here is the mail I sent to 2d-dev list.

---------- Forwarded message ----------
From: Laurent Bourgès <bourges.laurent at gmail.com>
Date: 2013/3/22
Subject: sun.java2D.pisces big memory usage (waste ?)
To: 2d-dev at openjdk.java.net


Dear all,

I recently profiled my swing application (Aspro2: http://www.jmmc.fr/aspro)
using the netbeans profiler (OpenJDK8 / linux x64) and in contrary to
Oracle JDK, it consumes a lot of memory in sun.java2D.pisces code as int[]
or float[] arrays:
- Helpers.widenArray : 25Mb
- Renderer<init>: 75 Mb (from AAShapePipe.draw)

Here are few profiler screenshots:
http://jmmc.fr/~bourgesl/share/pisces2D/

Aspro2 screenshot illustrating the plot that consumes a lot of memory:
http://jmmc.fr/~bourgesl/share/pisces2D/Capture-Aspro2.png

My application uses jfreechart that calls graphics2D.draw(shape) where
shape is always a rectangle / line with antialiasing enabled.

Several questions:
- Why is the antialiasing performed in java code ? I mean is it possible to
use OpenGL or XRender pipelines to perform such tasks ?
- Is there some docs explaining the java2D code and the different
implementations (openjdk, oracle, xrender, opengl ...) ?
- how could I help improving that code (Renderer ...) to avoid so many
array allocations / resizing (array sizing or using a thread context object
to reuse allocated int[] / float[] arrays) ?

Does somebody work on that topic ? has some ideas to optimize that code
(pisces) ?

Regards,
Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/graphics-rasterizer-dev/attachments/20130322/41b70a19/attachment.html 


More information about the graphics-rasterizer-dev mailing list