[MAPSERVER-USERS] leaking memory in java mapscript (was Re: thread safety)

rich.fromm nospam420 at yahoo.com
Wed Feb 20 21:36:34 EST 2008



rich.fromm wrote:
> 
> p.s. This is all based on mapserver 5.0.0
> 

I had built Java mapscript as shown below with the swig version for debian
3.1
(sarge), which is 1.3.24.  It seemed to work, so I had assumed that
everything
was okay.

But I do see that mapscript/java/README says the following:

--- begin ---
SWIG wrappers
-------------

MapServer releases, beginning with 4.2.4, contain pre-generated wrapper code
(mapscript/java/mapscript_wrap.c) and class files (mapscript/java/edu).
Nevertheless it is recommended that you generate your own using the
"interface"
target in the Java Makefile.

Requires swig > 1.3.24. Version 1.3.28 or 1.3.29 are recommended.
--- end ---

I guess I assumed that because 1.3.24 seemed to work for me that perhaps the
'>' above was really a type that should have been '>='.  But perhaps it
really
is significant?  I'll try to rebuild tomorrow with a later version of swig
and
see if it makes a difference.

--- begin ---
[rich at peyote mapserver-5.0.0-5 16:09:21]$ pwd
/ext/home/rich/wrk/mapserver/mapserver-5.0.0-5
[rich at peyote mapserver-5.0.0-5 16:09:22]$ cd mapscript/java
[rich at peyote java 16:09:25]$ export JAVA_HOME=/usr/lib/j2sdk1.5-sun
[rich at peyote java 16:09:31]$ make interface
mkdir -p edu/umn/gis/mapscript 
swig -java -package edu.umn.gis.mapscript -outdir edu/umn/gis/mapscript -o
mapscript_wrap.c ../mapscript.i
[rich at peyote java 16:09:39]$ make
gcc -fpic -c -g -O2 -fPIC -Wall  -DHAVE_VSNPRINTF -DNEED_STRLCAT  
-DUSE_PROJ      -DUSE_GD_GIF -DUSE_GD_PNG -DUSE_GD_WBMP -DUSE_GD_FT
-DGD_HAS_FTEX_XSHOW -DGD_HAS_GDIMAGEGIFPTR -DGD_HAS_GETBITMAPFONTS -DUSE_AGG     
-DUSE_ICONV -DUSE_POSTGIS  -DUSE_THREAD -I/usr/local/include
-I/usr/local/include/agg2 -I/usr/include/freetype2        
-I/usr/include/postgresql        -I/usr/lib/j2sdk1.5-sun/include
-I/usr/lib/j2sdk1.5-sun/include/linux -fno-strict-aliasing mapscript_wrap.c
gcc -fpic -shared mapscript_wrap.o -o libmapscript.so  -L../.. -lmapserver
-L/usr/local/lib -lgd  -lfreetype -lpng -lz   -L/usr/local/lib -lagg
-laggfontfreetype  -lfreetype -lpng -lz   -lproj     -L/usr/lib -lpq   
-lpthread -lm -lstdc++    
javac edu/umn/gis/mapscript/*.java
jar cf mapscript.jar edu
[rich at peyote java 16:10:14]$ 
--- end ---

-- 
View this message in context: http://www.nabble.com/thread-safety-tp15514019p15603655.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list