MapScript Java memory management

Umberto Nicoletti umberto.nicoletti at GMAIL.COM
Tue May 29 03:14:38 EDT 2007


Arkadi,
we are improving mapscript memory management to make it both safe and
easy to use.
The details are explained here:

http://mapserver.gis.umn.edu/development/rfc/ms-rfc-24/

The current plan is to deliver rfc-24 with release 5 of mapserver.
Until rfc-24 is out be warned that the assembly of a map at runtime
(by adding layers, classes, styles, etc) can sometimes crash the JVM
and this explains exactly the kind of issues you are seeing.

As for guidelines:

http://mapserver.gis.umn.edu/docs/howto/javamapscript
http://mapserver.gis.umn.edu/docs/faq/thread_safety

HTH,
Umberto

On 5/29/07, Arkadi Shishlov <arkadi at mebius.lv> wrote:
> Are there guidelines documented what need to be done (additionally to VM garbage collection) to correctly remove unneeded objects (classObj, layerObj), and how to use objects that may exists outside of Map object hierarchy? Like colorObj, in particular. The previous threads on this list indicate that there are some problems.
> I'm asking because Tomcat is crashing for me sometimes and I suspect this because of colorObj
>    protected static colorObj[] symbolColors = {..}
>    style.setColor(symbolColors[i]);
> later the class is removed with removeClass(), also entire context is reloaded in development process. Is it correct use of colorObj? Or
>    style.getColor().setRGB()
> should be used? Which is rather verbose, because setRGB() takes all components separately.
> Any other quirks?
>



More information about the mapserver-users mailing list