Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/java8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ RUN cd /javaAction \
&& rm -rf /javaAction/src \
&& ./compileClassCache.sh

CMD ["java", "-Dfile.encoding=UTF-8", "-Xshareclasses:cacheDir=/javaSharedCache,readonly", "-Xquickstart", "-jar", "/javaAction/build/libs/javaAction-all.jar"]
ADD init.sh ./
RUN chmod 777 ./init.sh
CMD ["./init.sh"]
34 changes: 34 additions & 0 deletions core/java8/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

limit_in_bytes=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
heap_size=64
export JAVA_OPTS="-Dfile.encoding=UTF-8 -Xshareclasses:cacheDir=/javaSharedCache,readonly -Xquickstart"
export RESERVED_MEGABYTES=64

# If not default limit_in_bytes in cgroup
if [ "$limit_in_bytes" -ne "9223372036854771712" ]
then
limit_in_megabytes=$(expr $limit_in_bytes \/ 1048576)
heap_size=$(expr $limit_in_megabytes - $RESERVED_MEGABYTES)
export JAVA_OPTS="-Xmx${heap_size}m $JAVA_OPTS"
fi

echo JAVA_OPTS= $JAVA_OPTS

java $JAVA_OPTS -jar /javaAction/build/libs/javaAction-all.jar