<br><font size=2 face="sans-serif">Thank's Umberto. I did not know </font><font size=2><tt>-Xloggc</tt></font><font size=2 face="sans-serif">
before.</font>
<br>
<br><font size=2 face="sans-serif">As far as I understood </font><font size=2><tt>-Xloggc</tt></font><font size=2 face="sans-serif">
measures the memory allocated by the JVM.</font>
<br><font size=2 face="sans-serif">And this is the kind of memory which
is not hazardous ...</font>
<br>
<br><font size=2 face="sans-serif">Anyway I will look in this direction...</font>
<br>
<br><font size=2 face="sans-serif">Benedikt</font>
<br>
<br><font size=2><tt>Umberto Nicoletti &lt;umberto.nicoletti@gmail.com&gt;
schrieb am 29.06.2005 12:10:03:<br>
<br>
&gt; On 6/29/05, Benedikt Rothe &lt;umn-ms@hydrotec.de&gt; wrote:<br>
&gt; &gt; &nbsp;<br>
&gt; &gt; Hello Umberto <br>
&gt; &gt; &nbsp;<br>
&gt; &gt; Thank you for yout hint's! <br>
&gt; &gt; &nbsp;<br>
&gt; &gt; You are right: One should be cautios. But for the moment I have
the<br>
&gt; &gt; impression <br>
&gt; &gt; that we seeme to have found a way, which don't raise obvious
errors in the<br>
&gt; &gt; first <br>
&gt; &gt; moment :-) <br>
&gt; &gt; &nbsp;<br>
&gt; &gt; After the mentioned changes in mapcopy.c the approache <br>
&gt; &gt; (TomCat/MapScript/Connection-Pooling/MapCloning) seeme to <br>
&gt; &gt; work for us. (Working with Version 4.6) <br>
&gt; &gt; &nbsp;<br>
&gt; &gt; But: <br>
&gt; &gt; - We do need some more stress-testing.(We already made automated
<br>
&gt; &gt; &nbsp; http-requests from a Java-Programs. But this was definitly
not enough and <br>
&gt; &gt; &nbsp; not &quot;nasty&quot; enough!) <br>
&gt; <br>
&gt; jmeter is an excellent tool for stress/load testing (<br>
&gt; jakarta.apache.org/jmeter/ )<br>
&gt; <br>
&gt; &gt; - New problems could raise, if more or other features from<br>
&gt; &gt; mapserver/mapscript <br>
&gt; &gt; &nbsp; are used then we actualy do. <br>
&gt; &gt; - Memory footprint of the running-tomcat has to be watched!.
What about the<br>
&gt; &gt; size <br>
&gt; &gt; &nbsp; &nbsp;of the application after 100, 500, 600, 800 ...
requests? (I'm not quite<br>
&gt; &gt; shure how to do this!<br>
&gt; <br>
&gt; Use the -Xloggc:/tmp/gc.log to java when starting tomcat and then
run<br>
&gt; the stress tests. You should be able to see that if memory get<br>
&gt; correctly garbage collected the avail mem is almost always equal to
a<br>
&gt; certain initial size.<br>
&gt; Warning: this is not 100% error proof, but it should be start. try
googling...<br>
&gt; <br>
&gt; Ciao,<br>
&gt; Umberto<br>
&gt; <br>
&gt; &gt; &nbsp; &nbsp;Watching Java-Programs is difficult because of garbage-collections
...) <br>
&gt; &gt; &nbsp;<br>
&gt; &gt; Greetings <br>
&gt; &gt; Benedikt <br>
&gt; &gt; &nbsp;<br>
&gt; &gt; Umberto Nicoletti &lt;umberto.nicoletti@gmail.com&gt; schrieb
am 29.06.2005<br>
&gt; &gt; 11:03:46:<br>
&gt; &gt; <br>
&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;&gt; On 6/29/05, Benedikt Rothe &lt;umn-ms@hydrotec.de&gt;
wrote:<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;&gt; &gt; Dear List <br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;&gt; &gt; We are using MapScript/Tomcat/Java/OracleSpatial.
<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;&gt; &gt; We use mapObj.mapClone() to get a fresh mapObject
<br>
&gt; &gt; &nbsp;&gt; &gt; in each request without reading the Mapfile.
<br>
&gt; &gt; &nbsp;&gt; <br>
&gt; &gt; &nbsp;&gt; Benedikt,<br>
&gt; &gt; &nbsp;&gt; I would not do that (tm). In my apps I recreate a
fresh mapObj with<br>
&gt; &gt; &nbsp;&gt; each request &nbsp;as the overhead is mininum and
the benefits high (so<br>
&gt; &gt; &nbsp;&gt; that the ratio is in favor of this approach).<br>
&gt; &gt; &nbsp;&gt; Besides this is the only known method to work (as
far as I know) and<br>
&gt; &gt; &nbsp;&gt; this stems from the fact that mapserver was in the
beginning (and<br>
&gt; &gt; &nbsp;&gt; still is, with improvements) a CGI. As you might know
cgis are<br>
&gt; &gt; &nbsp;&gt; processes that are created by the web server to serve
a single request<br>
&gt; &gt; &nbsp;&gt; and then exit, so memory cleanup and thread safety
are non-issues for<br>
&gt; &gt; &nbsp;&gt; them.<br>
&gt; &gt; &nbsp;&gt; Even in php mapscript php must be used as a cgi (instead
of a DSO) to<br>
&gt; &gt; &nbsp;&gt; make sure that it works.<br>
&gt; &gt; &nbsp;&gt; <br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;&gt; &gt; We detected problems after we activated Connection-Pooling:
<br>
&gt; &gt; &nbsp;&gt; &gt; Tomcat crashed in mapObj.delete() <br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; <br>
&gt; &gt; &nbsp;&gt; I would not use connection pooling just because it
will not work<br>
&gt; &gt; &nbsp;&gt; reliably with Java Servlets for the reasons explained
above.<br>
&gt; &gt; &nbsp;&gt; <br>
&gt; &gt; &nbsp;&gt; This matter (connection pooling and map cloning) surely
requires<br>
&gt; &gt; &nbsp;&gt; deeper investigation, one of the developers coul step
in to give his<br>
&gt; &gt; &nbsp;&gt; opinion on my statements (which I would sincerely
hope were false, but<br>
&gt; &gt; &nbsp;&gt; fear not). Btw, I seem to recall that the above issues
(long lived<br>
&gt; &gt; &nbsp;&gt; instance against per request instance) &nbsp;were
already discussed on the<br>
&gt; &gt; &nbsp;&gt; list before.<br>
&gt; &gt; &nbsp;&gt; <br>
&gt; &gt; &nbsp;&gt; Best regards,<br>
&gt; &gt; &nbsp;&gt; Umberto<br>
&gt; &gt; &nbsp;&gt; &nbsp; <br>
&gt; &gt; &nbsp;&gt; &gt; Hole thing turned out to be a bug in mapcopy.c
where <br>
&gt; &gt; &nbsp;&gt; &gt; the joins are copied: <br>
&gt; &gt; &nbsp;&gt; &gt; -------------------- <br>
&gt; &gt; &nbsp;&gt; &gt; MS_COPYSTELEM(numjoins); <br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;&gt; &gt; for (i = 0; i &lt; dst-&gt;numprocessing; i++)
{ <br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp; &nbsp;return_value = msCopyJoin(&amp;(dst-&gt;joins[i]),
&amp;(src-&gt;joins[i])); <br>
&gt; &gt; &nbsp;&gt; &gt; -------------------- <br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;&gt; &gt; This must be changed to <br>
&gt; &gt; &nbsp;&gt; &gt; -------------------- <br>
&gt; &gt; &nbsp;&gt; &gt; MS_COPYSTELEM(numjoins); <br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;&gt; &gt; for (i = 0; i &lt; dst-&gt;numjoins; i++) { <br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp; &nbsp;return_value = msCopyJoin(&amp;(dst-&gt;joins[i]),
&amp;(src-&gt;joins[i])); <br>
&gt; &gt; &nbsp;&gt; &gt; -------------------- <br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;&gt; &gt; There is some other code in mapobject.c, wich
didn't <br>
&gt; &gt; &nbsp;&gt; &gt; raise any problems for us, but from wich I do
think <br>
&gt; &gt; &nbsp;&gt; &gt; that array-allocs are missing. <br>
&gt; &gt; &nbsp;&gt; &gt; I watched the code an *think* these are are not
allocated <br>
&gt; &gt; &nbsp;&gt; &gt; anywhere. I hope, there is no misleading hint:
<br>
&gt; &gt; &nbsp;&gt; &gt; <br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;----------------------------<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;// I do think, that dst-&gt;point is not
allocated.<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;// code seems to be unused (?)<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;dst-&gt;numpoints = src-&gt;numpoints;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;for (i = 0; i &lt; dst-&gt;numpoints; i++)
{<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp; MS_COPYPOINT(&amp;(dst-&gt;point[i]),
&amp;(src-&gt;point[i]));<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;}<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;----------------------------<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;// I do think, that dst-&gt;items and dst-&gt;values
is<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;// not allocated<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;MS_COPYSTELEM(numitems);<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;for (i = 0; i &lt; dst-&gt;numitems; i++)
{<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp; MS_COPYSTRING(dst-&gt;items[i], src-&gt;items[i]);<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp; MS_COPYSTRING(dst-&gt;values[i], src-&gt;values[i]);<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;}<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;-----------------------------<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;// I'm quite shure, that dst-&gt;items
is not allocated<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;MS_COPYSTELEM(numitems);<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;for (i = 0; i &lt; dst-&gt;numitems; i++)
{<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp; MS_COPYSTRING(dst-&gt;items[i], src-&gt;items[i]);<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;}<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;<br>
&gt; &gt; &nbsp;&gt; &gt; I hope this is helpful. Greetings <br>
&gt; &gt; &nbsp;&gt; &gt; Benedikt Rothe<br>
&gt; &gt;<br>
</tt></font>