[OpenJDK Rasterizer] Fwd: sun.java2D.pisces big memory usage (waste ?)
Laurent Bourgès
bourges.laurent at gmail.com
Mon Mar 25 02:01:31 PDT 2013
Dear Donald, Dalibor and 2D-dev members,
During the week end, I looked (deeply) at java2D.pisces renderer (linux AA
shape renderer) and I started improving huge memory allocations (int[],
float[]) that has two impacts:
- GC overhead
- performance due to array resizing (arraycopy / grow)
Who knows how pisces work and could support / sponsor me if I have any
question ?
I sent an email to 2d-dev and rasterizer mailing lists but got no answer:
Is there anybody interested in that performance topic ? (Jim Graham, at
least)
Anyone could explain me the java2D AA code and its different
implementations openjdk (pisces), oracle (ductus) ... ?
Could such AA algorithm be performed by openGL / directx instead ?
Best regards,
Laurent
---------- 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/20130325/395e5aa5/attachment.html
More information about the graphics-rasterizer-dev
mailing list