Skip to content

Commit

Permalink
Merge pull request #59 from rhuss/master
Browse files Browse the repository at this point in the history
Merged in latest changes from run-java-sh
  • Loading branch information
rhuss authored Jan 13, 2017
2 parents 1f0d2b8 + 3e48744 commit bbaed67
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
12 changes: 7 additions & 5 deletions java/images/jboss/container-limits
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ max_memory() {
fi
}

local limit="$(core_limit)"
limit="$(core_limit)"
if [ x$limit != x ]; then
export CONTAINER_CORE_LIMIT="$limit"
export CONTAINER_CORE_LIMIT="${limit}"
fi
unset limit

local max_mem="$(max_memory)"
if [ x$max_mem != x ]; then
export CONTAINER_MAX_MEMORY="$max_mem"
limit="$(max_memory)"
if [ x$limit != x ]; then
export CONTAINER_MAX_MEMORY="$limit"
fi
unset limit
4 changes: 2 additions & 2 deletions java/images/jboss/java-default-options
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# Usage: JAVA_OPTIONS="$(java-default-options.sh)"

# Env Vars respected:
# Env Vars evaluated:

# JAVA_OPTIONS: Checked for already set options
# JAVA_MAX_MEM_RATIO: Ratio use to calculate a default maximum Memory, in percent.
Expand Down Expand Up @@ -70,5 +70,5 @@ cpu_core_tunning() {
fi
}

## Echo options, trimming trailing and multiple spaces
# Echo options, trimming trailing and multiple spaces
echo "$(max_memory) $(diagnostics) $(cpu_core_tunning)" | awk '$1=$1'
12 changes: 7 additions & 5 deletions java/images/rhel/container-limits
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ max_memory() {
fi
}

local limit="$(core_limit)"
limit="$(core_limit)"
if [ x$limit != x ]; then
export CONTAINER_CORE_LIMIT="$limit"
export CONTAINER_CORE_LIMIT="${limit}"
fi
unset limit

local max_mem="$(max_memory)"
if [ x$max_mem != x ]; then
export CONTAINER_MAX_MEMORY="$max_mem"
limit="$(max_memory)"
if [ x$limit != x ]; then
export CONTAINER_MAX_MEMORY="$limit"
fi
unset limit
4 changes: 2 additions & 2 deletions java/images/rhel/java-default-options
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# Usage: JAVA_OPTIONS="$(java-default-options.sh)"

# Env Vars respected:
# Env Vars evaluated:

# JAVA_OPTIONS: Checked for already set options
# JAVA_MAX_MEM_RATIO: Ratio use to calculate a default maximum Memory, in percent.
Expand Down Expand Up @@ -70,5 +70,5 @@ cpu_core_tunning() {
fi
}

## Echo options, trimming trailing and multiple spaces
# Echo options, trimming trailing and multiple spaces
echo "$(max_memory) $(diagnostics) $(cpu_core_tunning)" | awk '$1=$1'

0 comments on commit bbaed67

Please sign in to comment.