From e6b9b23290ee30d87cb140e66c04a4962c40ee07 Mon Sep 17 00:00:00 2001
From: orbiter
Date: Thu, 22 Sep 2005 01:17:49 +0000
Subject: [PATCH] configuration of startup-memory in webinterface
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@771 6c8d7289-2bf4-0310-a012-ef5d649a1542
---
htroot/PerformanceMemory_p.html | 24 ++++++++++++++++++------
htroot/PerformanceMemory_p.java | 19 ++++++++++++++++---
stopYACY.command | 3 +++
yacy.init | 11 +++++++++++
4 files changed, 48 insertions(+), 9 deletions(-)
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:
@@ -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