Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-04-08 Thread Andrea Aime
On Fri, Apr 5, 2013 at 4:32 PM, Laurent Bourgès wrote: > Dear all, > > Here is my first pisces (beta) patch (webrev): > http://jmmc.fr/~bourgesl/share/java2d-pisces/webrev-1/ > > I succeed in fixing memory usage by having only 1 pisces instance > (Renderer, stroker, iterator ...) per RendererConte

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-04-08 Thread Laurent Bourgès
Andrea, Any feedback from anybody else ? Here are J2D Bench results: http://jmmc.fr/~bourgesl/share/java2d-pisces/j2DBench/ Depending on the test, performance gains varies from 20% to 100% ! I think it could be nice if you can perform tests (regression and benchmarks using MapBench, J2DBench, J

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-04-05 Thread Laurent Bourgès
Dear all, Here is my first pisces (beta) patch (webrev): http://jmmc.fr/~bourgesl/share/java2d-pisces/webrev-1/ I succeed in fixing memory usage by having only 1 pisces instance (Renderer, stroker, iterator ...) per RendererContext (GC friendly). Impressive results between small and large drawin

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-04-04 Thread Laurent Bourgès
I updated both patched pisces code and benchmarks: http://jmmc.fr/~bourgesl/share/java2d-pisces/ Few results comparing ThreadLocal vs ConcurrentLinkedQueue usage: OpenJDK 8 PATCH ThreadLocal mode: Testing file /home/bourgesl/libs/openjdk/mapbench/test/dc_boulder_2013-13-30-06-13-17.ser 1 threads

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-04-03 Thread Laurent Bourgès
Thanks for your valueable feedback! Here is the current status of my patch alpha version: >> http://jmmc.fr/~bourgesl/share/java2d-pisces/ >> >> There is still a lot to be done: clean-up, stats, pisces class instance >> recycling (renderer, stroker ...) and of course sizing correctly initial >> ar

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-04-01 Thread Andrea Aime
On Fri, Mar 29, 2013 at 3:16 PM, Laurent Bourgès wrote: > Andrea, > > It could be very interesting if you could provide some concrete example > about your map server: typical image height / width, shape complexity > (number, size, path sizes ...). > It's all over the place. Image size: from 256x2

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-04-01 Thread Andrea Aime
On Sat, Mar 30, 2013 at 2:01 PM, Laurent Bourgès wrote: > - clipping issues (dasher, stroker) and spatial resolution (no cpu/memory > waste) > I see, yes. Indeed in the GeoServer code we already work around some of those issues by clipping the geometries read from the database to the graphics2d v

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-04-01 Thread Jim Graham
Other thoughts - using chained buckets of edges instead of one single long list. It would be easier to keep a pool of buckets (each holding, say, 256 edges?) than a "one-size-fits-all" pool of arrays. Then all you have to do is keep high water marks on the number of simultaneously used bucket

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-03-30 Thread Laurent Bourgès
Andrea, thanks for these estimates / stats. I think such use case could benefit a lot from my patch (low memory footprint) but thread-safe cached / reused arrays/ LineIteratorData / StrokerData / DasherData. As I said to Jim, there are two sort of problems: - memory handling (growable arrays) ha

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-03-30 Thread Laurent Bourgès
Jim, There are finally only few growable arrays (edges, curves, rowAARLE) and now I have a working Pisces code (J2DBench pass OK) that performs better than current (2x - 3x faster on dasher or big shapes) using only few megabytes (Xmx32m) ... Moreover, these arrays could be created once per threa

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-03-29 Thread Andrea Aime
On Thu, Mar 28, 2013 at 9:49 PM, Phil Race wrote: > At the same time, the current decision is affecting some applications >> badly. >> I've seen the same happening for another old java2d bug, where the alpha >> tile is cached and coordinated with JVM synchronized statement that kill >> scalabilit

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-03-29 Thread Andrea Aime
On Thu, Mar 28, 2013 at 8:38 PM, Phil Race wrote: > Maintaining a pool of objects might be an appropriate thing for an > applications, > but its a lot trickier for the platform as the application's usage pattern > or intent > is largely unknown. Weak references or soft references might be of use

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-03-29 Thread Phil Race
B'ccing discuss and core-libs as I realise this is mostly spam for those lists. On 3/28/2013 1:40 PM, Andrea Aime wrote: On Thu, Mar 28, 2013 at 8:38 PM, Phil Race > wrote: Maintaining a pool of objects might be an appropriate thing for an applications,

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-03-29 Thread Laurent Bourgès
Andrea, It could be very interesting if you could provide some concrete example about your map server: typical image height / width, shape complexity (number, size, path sizes ...). Ideally if you could write a test class (sample) computing a single image it would be very helpful for me to compar

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-03-29 Thread Laurent Bourgès
Phil, I agree it is a complex issue to improve memory usage while maintaining performance at the JDK level: applications can use java2d pisces in very different contexts: Swing app (client with only EDT thread), server-side application (multi thread headless) ... For the moment, I spent a lot of

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-03-28 Thread Phil Race
B'ccing discuss and core-libs as I realise this is mostly spam for those lists. On 3/28/2013 1:40 PM, Andrea Aime wrote: On Thu, Mar 28, 2013 at 8:38 PM, Phil Race > wrote: Maintaining a pool of objects might be an appropriate thing for an applications,

Re: [OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-03-28 Thread Phil Race
Maintaining a pool of objects might be an appropriate thing for an applications, but its a lot trickier for the platform as the application's usage pattern or intent is largely unknown. Weak references or soft references might be of use but weak references usually go away even at the next increm

[OpenJDK 2D-Dev] sun.java2D.pisces big memory usage (waste ?)

2013-03-26 Thread Laurent Bourgès
Dear all, First I joined recently the openJDK contributors, and I plan to fix java2D pisces code in my spare time. I have a full time job on Aspro2: http://www.jmmc.fr/aspro; it is an application to prepare astronomical observations at VLTI / CHARA and is very used in our community (200 users): i