[MAPSERVER-USERS] detecting memory leaks in java mapscript

rich.fromm nospam420 at yahoo.com
Wed Feb 20 18:50:40 EST 2008



Tamas Szekeres wrote:
> 
> Have you tried making a threadtest with your mapfile?
> 

It was a little bit of a pain, but I did manage to get the threadtest to
compile and run.

I had to recompile mapserver because it requires both GEOS and TIFF, neither
of which I had compiled for.  (I think this is a minor doc bug --
README_THREADTEST.TXT mentions the need for GEOS support, but it doesn't
mention the need for TIFF support.)

Also, the code as shipped with mapserver 5.0.0 doesn't compile, because the
layerObj class has no setTransparency() method.  So I had to comment out a
line, as shown below:

$ diff -u MapThread.java.~1~ MapThread.java
--- MapThread.java.~1~	2006-08-25 00:15:45.000000000 -0700
+++ MapThread.java	2008-02-20 13:43:23.000000000 -0800
@@ -68,7 +68,8 @@
 				//bufferLayer.setType(mapscriptConstants.MS_LAYER_POLYGON);
 				bufferLayer.setProjection("init=epsg:4326");
 				bufferLayer.setType(MS_LAYER_TYPE.MS_LAYER_POINT);
-				bufferLayer.setTransparency(50);
+            // XXX there is no layerObj.setTransparency() method
+				//bufferLayer.setTransparency(50);
 				classObj clazz=new classObj(bufferLayer);
 				clazz.setName("Buffer class");
 				styleObj style=new styleObj(clazz);

I should probably file a bug on that.

Anyway, I tried running the test on the included test.map file with 1 thread
and 10000 iterations, and indeed it doesn't leak.

But I'm not sure how applicable that is to my situation.  The test is not
necessarily using the same mapscript methods that I am.  And the map file is
completely different, and there seems to be a correspondence between the
two.  In other words, I can't just substitute my map file and run the
threadtest on it.  (I tried, it doesn't work.  And my mapfile works just
fine standalone and with my tests.)

- Rich

-- 
View this message in context: http://www.nabble.com/detecting-memory-leaks-in-java-mapscript-tp15580371p15601833.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list