Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
configuration of startup-memory in webinterface
orbitere6b9b23290ee
diff --git a/htroot/PerformanceMemory_p.html b/htroot/PerformanceMemory_p.htmlindex 39a8c5c6e..735a77430 100644--- a/htroot/PerformanceMemory_p.html+++ b/htroot/PerformanceMemory_p.html@@ -10,29 +10,32 @@<br><h2>Performance Settings for Memory</h2>-<p><div class=small><b>Memory Usage:</b></div><table border="0" cellpadding="2" cellspacing="1">+<form action="PerformanceMemory_p.html" method="post" enctype="multipart/form-data"><tr class="TableHeader" valign="bottom"><td class="small"> <br>Type</td><td class="small">After Startup<br> </td><td class="small">After Initializations<br>before GC</td><td class="small">After Initializations<br>after GC</td><td class="small">Now<br>#(gc)#before <a href="PerformanceMemory_p.html?gc=">GC</a>::after GC#(/gc)#</td>+<td class="small">Next<br>Startup</td><td class="small">Description<br> </td></tr><tr class="TableCellDark"><td class="TableHeader" align="left">Max</td><td class="small" align="center" colspan="4">#[memoryMax]# MByte</td>+<td class="small" align="right"><input name="Xmx" type="text" align="right" size="3" maxlength="3" value="#[Xmx]#"><br>MByte</td><td class="small" align="left">maximum memory that the JVM will attempt to use</td></tr><tr class="TableCellDark"><td class="TableHeader" align="left">Available</td>-<td class="small" align="right">#[memoryAvailAfterStartup]# KByte</td>-<td class="small" align="right">#[memoryAvailAfterInitBGC]# KByte</td>-<td class="small" align="right">#[memoryAvailAfterInitAGC]# KByte</td>+<td class="small" align="right">#[memoryAvailAfterStartup]# MByte</td>+<td class="small" align="right">#[memoryAvailAfterInitBGC]# MByte</td>+<td class="small" align="right">#[memoryAvailAfterInitAGC]# MByte</td><td class="small" align="right">#[memoryAvailNow]# MByte</td>+<td class="small" align="right"> <br> </td><td class="small" align="left">total available memory including free for the JVM within maximum</td></tr><tr class="TableCellDark">@@ -41,6 +44,7 @@<td class="small" align="right">#[memoryTotalAfterInitBGC]# KByte</td><td class="small" align="right">#[memoryTotalAfterInitAGC]# KByte</td><td class="small" align="right">#[memoryTotalNow]# MByte</td>+<td class="small" align="right"><input name="Xms" type="text" align="right" size="3" maxlength="3" value="#[Xms]#"><br>MByte</td><td class="small" align="left">total memory taken from the OS</td></tr><tr class="TableCellDark">@@ -49,6 +53,7 @@<td class="small" align="right">#[memoryFreeAfterInitBGC]# KByte</td><td class="small" align="right">#[memoryFreeAfterInitAGC]# KByte</td><td class="small" align="right">#[memoryFreeNow]# MByte</td>+<td class="small" align="right"> <br> </td><td class="small" align="left">free memory in the JVM within total amount</td></tr><tr class="TableCellDark">@@ -57,8 +62,15 @@<td class="small" align="right">#[memoryUsedAfterInitBGC]# KByte</td><td class="small" align="right">#[memoryUsedAfterInitAGC]# KByte</td><td class="small" align="right">#[memoryUsedNow]# MByte</td>+<td class="small" align="right"> <br> </td><td class="small" align="left">used memory in the JVM within total amount</td></tr>+<tr class="TableCellLight">+<td class="small" align="right" colspan="5">Re-Configuration of Startup Paramenters: </td>+<td class="small" align="right"><input type="submit" name="setStartup" value="Set"></td>+<td class="small" align="left">Changes take effect after <b>re-start</b> of YaCy<br>this works only on linux/unix systems</td>+</tr>+</form></table></p>@@ -254,12 +266,12 @@ Increasing this cache may speed up the peer-ping.</td></tr><tr class="TableCellLight">-<td class="small" align="left" colspan="8">Re-Configuration:</td>+<td class="small" align="right" colspan="8">Re-Configuration:</td><td class="small" align="center"><input type="submit" name="setCustom" value="Set"><br>these<br>custom<br>values<br> </td><td class="small" align="center"><input type="submit" name="setDefault" value="Set"><br>all<br>default<br>values<br> </td><td class="small" align="center"><input type="submit" name="setGood" value="Set"><br>all<br>recom-<br>mended values</td><td class="small" align="center"><input type="submit" name="setBest" value="Set"><br>all<br>optimum<br>values<br> </td>-<td class="small" align="center">Changes take effect after <b>re-start</b> of YaCy</td>+<td class="small" align="left">Changes take effect after <b>re-start</b> of YaCy</td></tr></form>diff --git a/htroot/PerformanceMemory_p.java b/htroot/PerformanceMemory_p.javaindex 900d992b9..5f67f408e 100644--- a/htroot/PerformanceMemory_p.java+++ b/htroot/PerformanceMemory_p.java@@ -106,6 +106,12 @@ public class PerformanceMemory_p {Runtime.getRuntime().gc();prop.put("gc", 1);}+ if (post.containsKey("Xmx")) {+ env.setConfig("javastart_Xmx", "Xmx" + post.get("Xmx", "64") + "m");+ }+ if (post.containsKey("Xms")) {+ env.setConfig("javastart_Xms", "Xms" + post.get("Xms", "10") + "m");+ }}long memoryFreeNow = Runtime.getRuntime().freeMemory();@@ -119,9 +125,9 @@ public class PerformanceMemory_p {long memoryMax = Runtime.getRuntime().maxMemory();prop.put("memoryMax", memoryMax / MB);- prop.put("memoryAvailAfterStartup", (memoryMax - memoryTotalAfterStartup + memoryFreeAfterStartup) / KB);- prop.put("memoryAvailAfterInitBGC", (memoryMax - memoryTotalAfterInitBGC + memoryFreeAfterInitBGC) / KB);- prop.put("memoryAvailAfterInitAGC", (memoryMax - memoryTotalAfterInitAGC + memoryFreeAfterInitAGC) / KB);+ prop.put("memoryAvailAfterStartup", (memoryMax - memoryTotalAfterStartup + memoryFreeAfterStartup) / MB);+ prop.put("memoryAvailAfterInitBGC", (memoryMax - memoryTotalAfterInitBGC + memoryFreeAfterInitBGC) / MB);+ prop.put("memoryAvailAfterInitAGC", (memoryMax - memoryTotalAfterInitAGC + memoryFreeAfterInitAGC) / MB);prop.put("memoryAvailNow", (memoryMax - memoryTotalNow + memoryFreeNow) / MB);prop.put("memoryTotalAfterStartup", memoryTotalAfterStartup / KB);prop.put("memoryTotalAfterInitBGC", memoryTotalAfterInitBGC / KB);@@ -192,6 +198,13 @@ public class PerformanceMemory_p {prop.put("dfltTotal", dfltTotal / MB);prop.put("goodTotal", goodTotal / MB);prop.put("bestTotal", bestTotal / MB);++ // parse initialization memory settings+ String Xmx = (String) env.getConfig("javastart_Xmx", "Xmx64m").substring(3);+ prop.put("Xmx", Xmx.substring(0, Xmx.length() - 1));+ String Xms = (String) env.getConfig("javastart_Xms", "Xms10m").substring(3);+ prop.put("Xms", Xms.substring(0, Xms.length() - 1));+// return rewrite values for templatesreturn prop;}diff --git a/stopYACY.command b/stopYACY.commandindex 833874a57..0b988d47e 100755--- a/stopYACY.command+++ b/stopYACY.command@@ -6,3 +6,6 @@ for N in `ls -1 lib/*.jar`; do CLASSPATH="$CLASSPATH$N:"; donefor N in `ls -1 libx/*.jar`; do CLASSPATH="$CLASSPATH$N:"; donejava -classpath classes:htroot:$CLASSPATH yacy -shutdown++echo "please wait until the YaCy daemon process terminates"+echo "you can monitor this with 'tail -f DATA/LOG/yacy00.log' and 'fuser log/yacy00.log'"diff --git a/yacy.init b/yacy.initindex 544d75238..3bb92cf1d 100644--- a/yacy.init+++ b/yacy.init@@ -464,6 +464,17 @@ ramCacheWiki = 8192# ram cache for news1.dbramCacheNews = 8192+# default memory settings for startup of yacy+# is only valid in unix/shell environments and+# not for first startup of YaCy++# -Xms<size> set initial Java heap size+javastart_Xmx=Xmx64m++# -Xmx<size> set maximum Java heap size+javastart_Xms=Xms10m++# performance properties for the word index cache# wordCacheMax is the number of word indexes that shall be held in the# ram cache during indexing. When YaCy is shut down, this cache must be