removed Xms java memory startup parameter

We will use the default value for now on.
This is much better for resource economy and fits better into a
container/docker/kubernetes strategy.
Furthermore, a small memory footprint is essential for the usage on
small devices like RaspberryPi.
This commit is contained in:
Michael Peter Christen 2021-07-19 20:04:11 +02:00
parent c3b3087077
commit 15b7461bc7
11 changed files with 31 additions and 49 deletions

View File

@ -18,10 +18,10 @@ before_install:
- sudo apt-get install -y ghostscript dpkg-dev debhelper m4 fakeroot
install:
- cd libbuild && MAVEN_OPTS="-Xmx6g -Xms2g" mvn clean install && cd ..
- cd libbuild && MAVEN_OPTS="-Xmx2g" mvn clean install && cd ..
script:
- MAVEN_OPTS="-Xmx6g -Xms2g" mvn clean install
- MAVEN_OPTS="-Xmx2g" mvn clean install
# test build instructions
- ant
- ant dist

View File

@ -174,8 +174,6 @@ fi
if [ -f \$DATA_HOME/SETTINGS/yacy.conf ]; then
i=\`grep javastart_Xmx \$DATA_HOME/SETTINGS/yacy.conf\`;
JAVA_MAX="-\${i#javastart_Xmx=}";
i=\`grep javastart_Xms \$DATA_HOME/SETTINGS/yacy.conf\`;
JAVA_MIN="-\${i#javastart_Xms=}";
fi
CLASSPATH="\$YACY_HOME/classes:."
@ -194,7 +192,6 @@ fi
WTF=\$1; shift
if [ "\$1" == "--max" ]; then JAVA_MAX="-Xmx\$2"; shift; shift; fi
if [ "\$1" == "--min" ]; then JAVA_MIN="-Xms\$2"; shift; shift; fi
if [ "\$1" == "--nice" ]; then NICE="nice -n \$2"; shift; shift; fi
if [ "\$1" == "--debug" ]; then DEBUG="-d"; shift; fi
shift

View File

@ -110,7 +110,7 @@ then
fi
else
JAVA_ARGS="-Xmx120m -Xms120m $JAVA_ARGS"
JAVA_ARGS="-Xmx120m $JAVA_ARGS"
fi
# generating the proper classpath

View File

@ -39,10 +39,8 @@ JAVA_ARGS="-Djava.awt.headless=true"
if [ -f DATA/SETTINGS/yacy.conf ]
then
# startup memory
for i in Xmx Xms; do
j="`grep javastart_$i DATA/SETTINGS/yacy.conf | sed 's/^[^=]*=//'`";
if [ -n $j ]; then JAVA_ARGS="-$j $JAVA_ARGS"; fi;
done
j="`grep javastart_Xmx DATA/SETTINGS/yacy.conf | sed 's/^[^=]*=//'`";
if [ -n $j ]; then JAVA_ARGS="-$j $JAVA_ARGS"; fi;
# Priority
j="`grep javastart_priority DATA/SETTINGS/yacy.conf | sed 's/^[^=]*=//'`";

View File

@ -677,7 +677,6 @@
</classpath>
<!--<arg value="-Xrunhprof"/>-->
<arg line="-start"/>
<jvmarg line="-Xms180m"/>
<jvmarg line="-Xmx800m"/>
<!-- <arg line="-migratewords"/>-->
<!-- <arg line="-start ${user.dir}"/>-->

View File

@ -760,11 +760,8 @@ cleanup.failedSearchURLtimeout = 86400000
# is valid in unix/shell and windows environments but
# not for first startup of YaCy
# -Xmx<size> and -Xms<size> maximum/init Java heap size
# 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
# -Xmx<size> maximum/init Java heap size
javastart_Xmx=Xmx600m
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

View File

@ -60,7 +60,7 @@ public class PerformanceQueues_p {
prop.put(TransactionManager.TRANSACTION_TOKEN_PARAM, TransactionManager.getTransactionToken(header));
// get segment
Segment indexSegment = sb.index;
final Segment indexSegment = sb.index;
if(post != null) {
/* Check the transaction is valid : validation apply then for every uses of this post parameter */
@ -81,9 +81,7 @@ public class PerformanceQueues_p {
if (post.containsKey("Xmx")) {
int xmx = post.getInt("Xmx", 600); // default maximum heap size
if (OS.isWin32) xmx = Math.min(2000, xmx);
int xms = xmx; //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");
/* Acquire a transaction token for the restart operation */
@ -155,7 +153,7 @@ public class PerformanceQueues_p {
sb.setConfig("performanceSpeed", post.getInt("profileSpeed", 100));
}
IndexCell<WordReference> rwi = indexSegment.termIndex();
final IndexCell<WordReference> rwi = indexSegment.termIndex();
while (threads.hasNext()) {
threadName = threads.next();
thread = sb.getThread(threadName);
@ -391,11 +389,9 @@ public class PerformanceQueues_p {
prop.put("remoteSearchSolrMaxLoad", sb.getConfigFloat(SwitchboardConstants.REMOTESEARCH_MAXLOAD_SOLR,
SwitchboardConstants.REMOTESEARCH_MAXLOAD_SOLR_DEFAULT));
// parse initialization memory settings
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", "Xms600m").substring(3);
prop.put("Xms", Xms.substring(0, Xms.length() - 1));
// parse initialization memory settings
final String Xmx = sb.getConfig("javastart_Xmx", "Xmx600m").substring(3);
prop.put("Xmx", Xmx.substring(0, Xmx.length() - 1));
final long diskFree = sb.getConfigLong(SwitchboardConstants.RESOURCE_DISK_FREE_MIN_STEADYSTATE, 3000L);
final long diskFreeHardlimit = sb.getConfigLong(SwitchboardConstants.RESOURCE_DISK_FREE_MIN_UNDERSHOT, 1000L);

View File

@ -14,7 +14,6 @@ Rem This target is used to read java runtime parameters out of the yacy config f
:GETSTARTOPTS
REM for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\yacy.conf) do (
REM if "%%i"=="javastart_Xmx" set jmx=%%j
REM if "%%i"=="javastart_Xms" set jms=%%j
REM )
Rem choose service runner executable according to processor architecture

View File

@ -11,7 +11,7 @@ Set CLASSPATH=lib\yacycore.jar
REM Please change the "javastart" settings in the web-interface "Basic Configuration" -> "Advanced"
set jmx=
set jms=
set javacmd=-Xmx600m -Xms180m
set javacmd=-Xmx600m
set priolvl=10
set priority=/BELOWNORMAL
if exist DATA\SETTINGS\httpProxy.conf GoTo :RENAMEINDEX
@ -56,7 +56,6 @@ Rem This target is used to read java runtime parameters out of the yacy config f
:GETSTARTOPTS
for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\yacy.conf) do (
if "%%i"=="javastart_Xmx" set jmx=%%j
if "%%i"=="javastart_Xms" set jms=%%j
if "%%i"=="javastart_priority" set priolvl=%%j
)
if defined jmx set javacmd=-%jmx%

View File

@ -192,10 +192,8 @@ fi
if [ -f $CONFIGFILE ]
then
# startup memory
for i in Xmx Xms; do
j="`grep javastart_$i $CONFIGFILE | sed 's/^[^=]*=//'`";
if [ -n "$j" ]; then JAVA_ARGS="-$j $JAVA_ARGS"; fi;
done
j="`grep javastart_Xmx $CONFIGFILE | sed 's/^[^=]*=//'`";
if [ -n "$j" ]; then JAVA_ARGS="-$j $JAVA_ARGS"; fi;
# Priority
j="`grep javastart_priority $CONFIGFILE | sed 's/^[^=]*=//'`";
@ -210,7 +208,7 @@ then
# JAVA_ARGS="-$i $JAVA_ARGS";
# done
else
JAVA_ARGS="-Xmx600m -Xms180m $JAVA_ARGS";
JAVA_ARGS="-Xmx600m $JAVA_ARGS";
PORT="8090"
fi

View File

@ -9,7 +9,7 @@ Set CLASSPATH=lib/yacycore.jar
REM Please change the "javastart" settings in the web-interface "Basic Configuration" -> "Advanced"
set jmx=
set jms=
set javacmd=-Xmx600m -Xms180m
set javacmd=-Xmx600m
set priolvl=10
set priority=/BELOWNORMAL
set port=8090
@ -60,7 +60,6 @@ Rem This target is used to read java runtime parameters out of the yacy config f
:GETSTARTOPTS
for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\yacy.conf) do (
if "%%i"=="javastart_Xmx" set jmx=%%j
if "%%i"=="javastart_Xms" set jms=%%j
if "%%i"=="port" set port=%%j
if "%%i"=="javastart_priority" set priolvl=%%j
)