diff --git a/htroot/PerformanceMemory_p.html b/htroot/PerformanceMemory_p.html index 39a8c5c6e..735a77430 100644 --- a/htroot/PerformanceMemory_p.html +++ b/htroot/PerformanceMemory_p.html @@ -10,29 +10,32 @@

Performance Settings for Memory

-

Memory Usage:
+ + + - - - + + + + @@ -41,6 +44,7 @@ + @@ -49,6 +53,7 @@ + @@ -57,8 +62,15 @@ + + + + + + +
 
Type
After Startup
 
After Initializations
before GC
After Initializations
after GC
Now
#(gc)#before GC::after GC#(/gc)#
Next
Startup
Description
 
Max #[memoryMax]# MByte
MByte
maximum memory that the JVM will attempt to use
Available#[memoryAvailAfterStartup]# KByte#[memoryAvailAfterInitBGC]# KByte#[memoryAvailAfterInitAGC]# KByte#[memoryAvailAfterStartup]# MByte#[memoryAvailAfterInitBGC]# MByte#[memoryAvailAfterInitAGC]# MByte #[memoryAvailNow]# MByte 
 
total available memory including free for the JVM within maximum
#[memoryTotalAfterInitBGC]# KByte #[memoryTotalAfterInitAGC]# KByte #[memoryTotalNow]# MByte
MByte
total memory taken from the OS
#[memoryFreeAfterInitBGC]# KByte #[memoryFreeAfterInitAGC]# KByte #[memoryFreeNow]# MByte 
 
free memory in the JVM within total amount
#[memoryUsedAfterInitBGC]# KByte #[memoryUsedAfterInitAGC]# KByte #[memoryUsedNow]# MByte 
 
used memory in the JVM within total amount
Re-Configuration of Startup Paramenters: Changes take effect after re-start of YaCy
this works only on linux/unix systems

@@ -254,12 +266,12 @@ Increasing this cache may speed up the peer-ping. -Re-Configuration: +Re-Configuration:
these
custom
values
 
all
default
values
 
all
recom-
mended values
all
optimum
values
  -Changes take effect after re-start of YaCy +Changes take effect after re-start of YaCy diff --git a/htroot/PerformanceMemory_p.java b/htroot/PerformanceMemory_p.java index 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 templates return prop; } diff --git a/stopYACY.command b/stopYACY.command index 833874a57..0b988d47e 100755 --- a/stopYACY.command +++ b/stopYACY.command @@ -6,3 +6,6 @@ for N in `ls -1 lib/*.jar`; do CLASSPATH="$CLASSPATH$N:"; done for N in `ls -1 libx/*.jar`; do CLASSPATH="$CLASSPATH$N:"; done java -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.init index 544d75238..3bb92cf1d 100644 --- a/yacy.init +++ b/yacy.init @@ -464,6 +464,17 @@ ramCacheWiki = 8192 # ram cache for news1.db ramCacheNews = 8192 +# default memory settings for startup of yacy +# is only valid in unix/shell environments and +# not for first startup of YaCy + +# -Xms set initial Java heap size +javastart_Xmx=Xmx64m + +# -Xmx 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