Strange mapscriptJNI_delete_1layerObj+0xf error killing Tomcat

Rodrigo Del C. Andrade rodrigo.andrade at DIGITRO.COM.BR
Thu May 31 13:39:06 EDT 2007


    Hello Umberto, thanks for the quick reply.
    More details about the app: its a website made of 7 or 8 modules 
with distinct java technologies, being one of them java mapscript.
    We use java 1.5.0.11 and Tomcat 5.5.17 on a RHAS 4 Update 4 on a 
server with 2 Intel core duos and 4gb ram (final machine is  4 
processors and 8gb ram, but she is still packed)
    There are some threads running nonstop on the background and we 
expect about 100 concurrent users at any given time. I dunno what else I 
could say about the that would prove useful.
    About mapscript itself, its version 4.10.1, MS_MAXSYMBOLS was 
increased to 256 and MS_MAXLAYERS on map.h was increased to 2000. It was 
compiled with the options:

./configure \
   --prefix=$MAPSERVER_HOME \
   --without-pdf \
   --with-threads \
   --with-zlib=$MAPSERVER_HOME \
   --with-png=$MAPSERVER_HOME/libpng \
   --with-tiff=$MAPSERVER_HOME/libtiff \
   --with-jpeg=$MAPSERVER_HOME/libjpeg \
   --with-freetype=$MAPSERVER_HOME/freetype \
   --with-proj=$MAPSERVER_HOME/proj4 \
   --with-geos=$MAPSERVER_HOME/geos/bin/geos-config \
   --with-gd=$MAPSERVER_HOME/gd \
   --with-ogr=$MAPSERVER_HOME/gdal/bin/gdal-config \
   --with-gdal=$MAPSERVER_HOME/gdal/bin/gdal-config \
   --with-curl-config=$MAPSERVER_HOME/libcurl/bin/curl-config \

   And on mapscript/java:
	make interface
	make
	make test (all tests pass)

    All these libraries where individually compiled on that machine 
before mapserver.

> I need to know more about your web application and especially about:
> - the type of data you have to access (shp, oracle, etc)
    We're using only shapefiles. About 20 shapefiles (every one of them 
have a spatial index created) and defined in the mapfile. There is also 
about 130 symbols defined in the mapfile.
    Layers: each city represented (those 20 shapefiles) has a set of 4 
layers: political limits, primary roads, secondary roads and district 
limits. There is also a shapefile with a union of all relevant polygons 
from above shapefiles which will be used to query density layer later, 
this one is defined in the mapfile but with status OFF
> - which objects are created at run time and in which order (in example
> you could have defined the map properties as a set of db tables (this
> seems popular these days) and then created the map by reading those
> tables)
    Map properties are read straight form mapfile. The actual creation 
and navigation (pan,zoom, etc) of the file does not present the problem. 
The feature that does, however, works like this:
    When the user first accesses the module, the initial mapObj is 
processed, created, shown and then stored on the session. Then the user 
can make a very detailed query (query window opens on a iframe) about 
the the subject of the software (I cant disclose) and a set of data is 
returned from the database. Among other stuff, the objects returned by 
the db contain a set of latlon coordinates and a symbolname.
    Then we grab the existing mapObj from the session and create layers 
(anything form 1 to 1000, depending on the query, but it seems to have 
no effect the problem at hand) to house new points. The order objects 
are created is:
    1. a layer is created and stored on the mapObj to house a clone of 
the points. This layer will be used on the density layer (step 7 below).
    Enter loop:
        2.layerObj to house new points.
        3. pointObj is created and set up with coordinates returned from 
db.
        4. lineObj to house the above point
        5. shapeOnj is created to house the above line. This shape 
receives a initValues(3) and 3 strings are stored on it too.
        6 . clone this shape and store a copy on the layer created on 
step 1.
    Exit loop
    7. walk trough all the shapes existent on the layer with the 
relevant polygons for density query and feed them trough a
    ThatLayerWithTheCopyOfPoints.queryByRect(shape.getBounds()) -> 
shape.contains(resulting points) type of construction so we can fill 
polygons with diferent colors according to amount of points inside them.
   
    This is pretty much the gist of it. There is a LOT of inline 
elements created trough the processing and much room for a GC screwup. 
The stuff to note however is:
    1 - The crash never happens mid processing, only after the resulting 
map after a query is fully processed, or even seconds or minutes later, and
    2 - it never happens on our development machines =(     Which makes 
me want to discard GC problems and look at the libmapscript.so built on 
that server, however the only difference in the whole compilation 
process is the linux distro: there being RHAS 4 and the machine I 
develop on (and where I built my personal .so) is Fedora 6.

> In any case, I would suggest you try to build mapserver from svn (the
> svn version incorporates rfc-24). You application would be a very
> useful test bed for rfc-24.
    I will do it and report back.
    I hope this info brings some light on the subject. Thanks a lot.

    Regards,

    Rod

-- 
*Rodrigo Del C. Andrade*
/Programador/
/SIC - SSE - Soluções Segurança Pública/

*DÍGITRO TECNOLOGIA*
*E-mail:* rodrigo.andrade at digitro.com.br 
<mailto:rodrigo.andrade at digitro.com.br>
*Fone:* +55 48 3281-7314 / +55 48 3281-7000
*Fax:* +55 48 3281-7299
*Site:* www.digitro.com <http://www.digitro.com>



More information about the mapserver-users mailing list