-mem options only used if not otherwise specified directly.

This commit is contained in:
Josh Suereth 2014-01-06 09:39:29 -05:00
parent 163c822ff3
commit 8e4dbbaf0c
1 changed files with 8 additions and 2 deletions

View File

@ -78,7 +78,7 @@ addDebugger () {
}
# a ham-fisted attempt to move some memory settings in concert
# so they need not be dorked around with individually.
# so they need not be messed around with individually.
get_mem_opts () {
local mem=${1:-1024}
local perm=$(( $mem / 4 ))
@ -86,7 +86,13 @@ get_mem_opts () {
(( $perm < 1024 )) || perm=1024
local codecache=$(( $perm / 2 ))
echo "-Xms${mem}m -Xmx${mem}m -XX:MaxPermSize=${perm}m -XX:ReservedCodeCacheSize=${codecache}m"
# if we detect any of these settings in ${java_opts} we need to NOT output our settings.
# The reason is the Xms/Xmx, if they don't line up, cause errors.
if [[ "${java_opts}" == *-Xmx* ]] || [[ "${java_opts}" == *-Xms* ]] || [[ "${java_opts}" == *-XX:MaxPermSize* ]] || [[ "${java_opts}" == *-XX:ReservedCodeCacheSize* ]]; then
echo ""
else
echo "-Xms${mem}m -Xmx${mem}m -XX:MaxPermSize=${perm}m -XX:ReservedCodeCacheSize=${codecache}m"
fi
}
require_arg () {