Avoid creating a new coordinate operation factory for each scale computation in 
RenderUtils
-------------------------------------------------------------------------------------------

                 Key: GEOT-973
                 URL: http://jira.codehaus.org/browse/GEOT-973
             Project: GeoTools
          Issue Type: Improvement
          Components: core render
    Affects Versions: 2.3.M0, 2.2.0, 2.2.1, 2.3
            Reporter: Andrea Aime
         Assigned To: Jesse Eichar
             Fix For: 2.2.1, 2.3


Gathering a new coordinate operation factory for each scale computation 
triggers some very
nasty OOMs in geoserver because for each call to getCoordinateOperationFactory 
apparently
8 factories come into existance and get deleted only after 30 minutes, populi

Here is the patch:

Index: .
===================================================================
--- .   (revision 21937)
+++ .   (working copy)
@@ -32,6 +32,13 @@
  */
 public class RendererUtilities
 {
+    protected static final CoordinateOperationFactory distanceOperationFactory;
+    
+    static {
+        Hints hints=new Hints(Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE);
+        distanceOperationFactory = 
FactoryFinder.getCoordinateOperationFactory(hints);
+    }
+    
    /**
     * Sets up the affine transform <p/>
     * ((Taken from the old LiteRenderer))
@@ -131,10 +138,6 @@
                cs[2] = p2.x;
                cs[3] = p2.y;            
                
-               Hints hints=new Hints(Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE);
-               CoordinateOperationFactory distanceOperationFactory = 
FactoryFinder.getCoordinateOperationFactory(hints);
-               
-                
                MathTransform transform = 
distanceOperationFactory.createOperation(coordinateReferenceSystem,DefaultGeographicCRS.WGS84).getMathTransform();
                transform.transform(cs, 0, csLatLong, 0, 2);
                

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to