Hi, Please review this bug fix for the Marlin renderer to improve the array caches, its usages but also the renderer stats: bug: https://bugs.openjdk.java.net/browse/JDK-8159638 webrev: http://cr.openjdk.java.net/~lbourges/marlin/marlin-8159638.0/
This patch also reduces slightly the memory footprint: 1 RendererContext represents now ~ 450K (310K on-heap / 140K off-heap). Changes: - Byte/Int/Float ArrayCache removed - replaced by Clean[Byte/Int/Float]ArrayCache (zero-filled arrays) and Dirty[Byte/Int/Float]ArrayCache classes (dirty arrays). These new classes provides a Reference class that wraps the initial array and acts as a proxy to the related array cache instance (get/widen//put Array) - ArrayCache: increased bucket to 8 (larger retained memory but weakly referenced) + added CacheStats (and BucketStats) - MarlinProperties: added setiings for initial edge capacity and align array sizes to 64 (power of 2) - RendererContext: large cleanup + use a weak reference for the recycled Path2D instance - RendererStats: big refactoring to create one RendererStats instance per created RendererContext instance (thread stats) and the new RendererStatsHolder class gathers all RendererStats instances to dump them at shutdown (very small retained memory instead of keeping all RendererContext instances) Tested with current jtreg tests (+ my MapBench tests) Regards, Laurent