Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

set Xms lower than Xmx

Michael Peter Christen8738336408c6
diff --git a/defaults/yacy.init b/defaults/yacy.init
index d94671b43..b09bed54f 100644
--- a/defaults/yacy.init
+++ b/defaults/yacy.init
@@ -621,7 +621,7 @@ cleanup.failedSearchURLtimeout = 86400000
# if a high performance for large search indexes is wanted, then setting the values to equal number is recommended
# if YaCy shall be nice in not-only-yacy environments, then the Xms value may be lower
javastart_Xmx=Xmx600m
-javastart_Xms=Xms600m
+javastart_Xms=Xms90m
# YaCy is able to use RAM copies of database tables. This needs a lot of RAM.
# To switch on copying of file tables int RAM, there must be enough memory
diff --git a/htroot/PerformanceQueues_p.java b/htroot/PerformanceQueues_p.java
index aa71f767b..ce90ff105 100644
--- a/htroot/PerformanceQueues_p.java
+++ b/htroot/PerformanceQueues_p.java
@@ -84,9 +84,9 @@ public class PerformanceQueues_p {
}
}
if (post.containsKey("Xmx")) {
- int xmx = post.getInt("Xmx", 500); // default maximum heap size
+ int xmx = post.getInt("Xmx", 600); // default maximum heap size
if (OS.isWin32) xmx = Math.min(2000, xmx);
- int xms = xmx; // take all.. if this is not used the os will manage that. if not reserved at the beginning the OS may reject to give away more memory
+ int xms = Math.min(xmx, Math.max(90, xmx / 10));
sb.setConfig("javastart_Xmx", "Xmx" + xmx + "m");
sb.setConfig("javastart_Xms", "Xms" + xms + "m");
prop.put("setStartupCommit", "1");
@@ -342,9 +342,9 @@ public class PerformanceQueues_p {
prop.put("priority_low",(curr_prio == 20) ? "1" : "0");
// parse initialization memory settings
- final String Xmx = sb.getConfig("javastart_Xmx", "Xmx500m").substring(3);
+ final String Xmx = sb.getConfig("javastart_Xmx", "Xmx600m").substring(3);
prop.put("Xmx", Xmx.substring(0, Xmx.length() - 1));
- final String Xms = sb.getConfig("javastart_Xms", "Xms500m").substring(3);
+ final String Xms = sb.getConfig("javastart_Xms", "Xms90m").substring(3);
prop.put("Xms", Xms.substring(0, Xms.length() - 1));
final long diskFree = sb.getConfigLong(SwitchboardConstants.DISK_FREE, 3000L);