-
Notifications
You must be signed in to change notification settings - Fork 419
/
grape_jvm_opts
63 lines (57 loc) · 2.33 KB
/
grape_jvm_opts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright 2022 Alibaba Group Holding Limited.
#
# Licensed 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.
#
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
if [[ "$GRAPHSCOPE_HOME"x == x ]];
then
echo "No GRAPHSCOPE_HOME found, infer from python package"
site_path=`python3 -m site --user-site`
export GRAPHSCOPE_HOME=${site_path}/graphscope.runtime/
echo "Infered GRAPHSCOPE_HOME "${gs_runtime}
fi
if [[ "$SPARK_HOME"x == x ]];
then
echo "[warn] No SPARK_HOME found!"
fi
GRAPHX_GRAPE_SDK=`ls ${GRAPHSCOPE_HOME}/lib/grape-graphx-*.jar`
GRAPE_RUNTIME_JAR=`ls ${GRAPHSCOPE_HOME}/lib/grape-runtime-*.jar`
# This env point to the directory where the output for llvm4jni run.sh on Grape-runtime.jar resides
if [[ "${RUNTIME_LLVM4JNI_OUTPUT}"x != x ]];
then
echo "find env RUNTIME_LLVM4JNI_OUTPUT, append to init java class path"
class_path=${RUNTIME_LLVM4JNI_OUTPUT}:${GRAPE_RUNTIME_JAR}:${GRAPHX_GRAPE_SDK}
else
class_path=${GRAPE_RUNTIME_JAR}:${GRAPHX_GRAPE_SDK}
fi
#include jars in spark/jars
if [ ! -z "${SPARK_HOME}" ]; then
jars=`ls ${SPARK_HOME}/jars`
for jar in ${jars}; do
class_path=${class_path}:${SPARK_HOME}/jars/${jar}
done
fi
jvm_version=$(${JAVA_HOME}/bin/javac -version 2>&1 | awk -F ' ' '{print $2}' | awk -F '.' '{print $1}')
if [[ "${jvm_version}" == *"11"* ]];then
_JVM_OPTS="-Xlog:gc*"
_JVM_OPTS=${_JVM_OPTS}" --illegal-access=warn"
else
_JVM_OPTS="-XX:+PrintGCDateStamps"
_JVM_OPTS=${_JVM_OPTS}" -XX:+PrintGCDetails"
fi
export GRAPE_JVM_OPTS="-Dcom.alibaba.fastffi.rvBuffer=2147483648 -XX:+StartAttachListener -XX:+PreserveFramePointer \
-XX:+UseG1GC -XX:G1HeapRegionSize=32M \
-XX:+PrintGCDetails -XX:+PrintGCDateStamps \
-XX:+UnlockDiagnosticVMOptions -XX:LoopUnrollLimit=1 -XX:-TieredCompilation \
-Djava.library.path=${GRAPHSCOPE_HOME}/lib \
-Djava.class.path=${class_path}"