[MAPSERVER-USERS] detecting memory leaks in java mapscript

rich.fromm nospam420 at yahoo.com
Tue Feb 19 17:26:04 PST 2008


Any advice about tracking down memory leaks that might exist in java
mapscript?

For the context of why I'm trying to do this, see the following thread:

  http://www.nabble.com/thread-safety-to15514019.html

I installed the debian sarge backport of valgrind (valgrind-3.2.0-Debian),
and
tried invoking java prefaced with:

  valgrind --leak-check=full --smc-check=all -v

No leaks were reported, but I don't think it really checked where I wanted
it
to check.  libmapscript.so is loaded with the following:

         System.loadLibrary("mapscript");

And from the output it doesn't look like valgrind is actually instrumenting
that library, and I can't figure out how to tell it to explicitly instrument
a
dynamically loaded library.

Yet the valgrind FAQ:

  http://valgrind.org/docs/manual/faq.html#faq.java

does indicate that this might at least be possible:

--- begin ---
in theory Valgrind can run any Java program just fine, even those that use
JNI and are partially implemented in other languages like C and C++.  In
practice, Java implementations tend to do nasty things that most programs
do not, and Valgrind sometimes falls over these corner cases. 
--- end ---

Sorry if this is more appropriately a valgrind question and not a mapserver
question, but I saw valgrind mentioned in a few places:

  HISTORY.TXT
  http://trac.osgeo.org/mapserver/ticket/2412

so I thought that maybe someone here might have experience as it relates to
this specific case.

- Rich

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




More information about the MapServer-users mailing list