<br><font size=2 face="sans-serif">Hallo Donovan</font>
<br>
<br><font size=2 face="sans-serif">Some month ago I made a posting about
&nbsp;Mapserver/Java-crashes</font>
<br><font size=2 face="sans-serif">in Java-Finalizers, which tries to explain
a problem on</font>
<br><font size=2 face="sans-serif">memory-managment in Mapserver/Javascript
&nbsp;(&quot;Java VM Crashes using the Mapscript API&quot;):</font>
<br>
<br><font size=2 face="sans-serif">http://article.gmane.org/gmane.comp.gis.mapserver.user/11536</font>
<br><font size=2 face="sans-serif">http://article.gmane.org/gmane.comp.gis.mapserver.user/11678</font>
<br>
<br><font size=2 face="Arial">Additional hint: I found bugs of this kind
by changing all existing </font>
<br><font size=2 face="Arial">Java-Mascript-finalizers which call &quot;delete()&quot;
to:</font>
<br>
<br><font size=2 face="Courier">&nbsp; protected void finalize() {</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; if(swigCPtr != 0 &amp;&amp;
swigCMemOwn) {</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; System.out.println(this.getClass().getName()
+ &quot;-finalize deallokiert&quot;);</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; }</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; delete();</font>
<br><font size=2 face="Courier">&nbsp; }</font>
<br>
<br><font size=2 face="sans-serif">The stdout will have messages for all
classes which are freed in a dangerous way.</font>
<br><font size=2 face="sans-serif">As long as this kind of messages one
should look for missing delete's.</font>
<br>
<br><font size=2 face="sans-serif">I hope this helps</font>
<br><font size=2 face="sans-serif">Benedikt Rothe</font>
<br>
<br><font size=2 face="sans-serif">PS: By following this rules the Java-App
became much more stable.</font>
<br><font size=2 face="sans-serif">But I still face problems of this kind
one some machines.</font>
<br>
<br><font size=2><tt>UMN MapServer Users List &lt;MAPSERVER-USERS@LISTS.UMN.EDU&gt;
schrieb am 15.11.2005 18:10:18:<br>
<br>
&gt; I've been working with mapscript and tomcat for several weeks, generally<br>
&gt; mapserver is working great but when i try to query a layer (tried
a polygon<br>
&gt; shp file, polygon tab file and a point tab file) the jvm crashes as
soon as<br>
&gt; getFeature is called. &nbsp;QueryByPoint and getResults appear to
work - i can<br>
&gt; iterate over the resultset and print shape indexes but getFeature
always<br>
&gt; crashes with this message:<br>
&gt; <br>
&gt; &gt; *** glibc detected *** free(): invalid pointer: 0x093f6e30 ***<br>
&gt; &gt; 15/11/2005 10:48:04 11023 jsvc.exec error: Service did not exit
cleanly<br>
&gt; <br>
&gt; Any ideas? &nbsp;I'm really stuck...<br>
&gt; <br>
&gt; Following is a snip of the code and some more detail:<br>
&gt; <br>
&gt; layer.queryByPoint(map,point,mapscriptConstants.MS_MULTIPLE,-1);<br>
&gt; resultCacheObj results = layer.getResults();<br>
&gt; layer.open();<br>
&gt; &nbsp; &nbsp; for (int i=0;i&lt;results.getNumresults();i++) {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; resultCacheMemberObj result = results.getResult(i);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; shapeObj feature =<br>
&gt; layer.getFeature(result.getShapeindex(),result.getTileindex());<br>
&gt; &nbsp; &nbsp; }<br>
&gt; f.realLayer.close();<br>
&gt; <br>
&gt; I'm using mapserver 4.8.0 but also tried 4.6.0 - same results<br>
&gt; I compiled mapserver myself with these flags<br>
&gt; --with-gdal --with-ogr --with-postgis --with-proj --with-threads --with-png<br>
&gt; --with-geos --with-gd --enable-debug<br>
&gt; <br>
&gt; gdal-1.2.6, &nbsp;proj-4.4.9 and geos-2.1.1 were installed using RPMs
from<br>
&gt; mappinghacks.com<br>
&gt; JDK 1.5.0_05<br>
&gt; Tomcat 5.0<br>
&gt; Fedora core 3<br>
&gt; <br>
&gt; I tried loading the jvm in GDB but it don't have the skill to track
down the<br>
&gt; source of the memory corruption.<br>
&gt; Searched the list, google and the documentation with no success...<br>
&gt; <br>
&gt; Donovan<br>
</tt></font>