1
+ @ echo off
2
+ rem Licensed to the Apache Software Foundation (ASF) under one or more
3
+ rem contributor license agreements. See the NOTICE file distributed with
4
+ rem this work for additional information regarding copyright ownership.
5
+ rem The ASF licenses this file to You under the Apache License, Version 2.0
6
+ rem (the "License"); you may not use this file except in compliance with
7
+ rem the License. You may obtain a copy of the License at
8
+ rem
9
+ rem http://www.apache.org/licenses/LICENSE-2.0
10
+ rem
11
+ rem Unless required by applicable law or agreed to in writing, software
12
+ rem distributed under the License is distributed on an "AS IS" BASIS,
13
+ rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ rem See the License for the specific language governing permissions and
15
+ rem limitations under the License.
16
+
17
+ if not exist " %JAVA_HOME% \bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! & goto end
18
+ set " JAVA = %JAVA_HOME% \bin\java.exe"
19
+
20
+ setlocal
21
+
22
+ set BASE_DIR = %~dp0
23
+ set BASE_DIR = %BASE_DIR:~0 ,-1 %
24
+ for %%d in (%BASE_DIR% ) do set BASE_DIR = %%~dpd
25
+
26
+ set CLASSPATH = .;%BASE_DIR% conf;%CLASSPATH%
27
+
28
+ rem ===========================================================================================
29
+ rem JVM Configuration
30
+ rem ===========================================================================================
31
+ set " JAVA_OPT = %JAVA_OPT% -server -Xms8g -Xmx8g -Xmn4g"
32
+ set " JAVA_OPT = %JAVA_OPT% -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:G1ReservePercent=25 -XX:InitiatingHeapOccupancyPercent=30 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:SurvivorRatio=8 -XX:+DisableExplicitGC"
33
+ set " JAVA_OPT = %JAVA_OPT% -verbose:gc -Xloggc:%HOMEPATH% \mq_gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy"
34
+ set " JAVA_OPT = %JAVA_OPT% -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=30m"
35
+ set " JAVA_OPT = %JAVA_OPT% -XX:-OmitStackTraceInFastThrow"
36
+ set " JAVA_OPT = %JAVA_OPT% -XX:+AlwaysPreTouch"
37
+ set " JAVA_OPT = %JAVA_OPT% -XX:MaxDirectMemorySize=15g"
38
+ set " JAVA_OPT = %JAVA_OPT% -XX:-UseLargePages -XX:-UseBiasedLocking"
39
+ set " JAVA_OPT = %JAVA_OPT% -Djava.ext.dirs=%BASE_DIR% lib"
40
+ set " JAVA_OPT = %JAVA_OPT% -cp %CLASSPATH% "
41
+
42
+ " %JAVA% " %JAVA_OPT% %*
43
+
44
+ :end
0 commit comments