31 lines
775 B
Batchfile
31 lines
775 B
Batchfile
@echo off
|
|
chcp 65001 > nul
|
|
set targetName=xk-admin
|
|
title %targetName%
|
|
echo 当前目录:%CD%
|
|
|
|
for /f "tokens=1" %%i in ('jps ^| findstr %targetName%.jar') do (
|
|
echo 正在终止进程 ID %%i
|
|
taskkill /PID %%i /F
|
|
)
|
|
|
|
REM 启动新进程
|
|
echo 启动%targetName%.jar...
|
|
start /b java ^
|
|
-Dfile.encoding=UTF-8 ^
|
|
-XX:+PrintGCDetails ^
|
|
-XX:+PrintGCDateStamps ^
|
|
-Xloggc:gc.log ^
|
|
-XX:+HeapDumpOnOutOfMemoryError ^
|
|
-XX:HeapDumpPath=./dumps ^
|
|
-XX:MetaspaceSize=256m ^
|
|
-XX:MaxMetaspaceSize=256m ^
|
|
-Xms1g -Xmx2g -Xmn1g -Xss256k ^
|
|
-XX:SurvivorRatio=8 ^
|
|
-XX:+UseG1GC ^
|
|
-XX:MaxGCPauseMillis=200 ^
|
|
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006 ^
|
|
-jar %targetName%.jar --spring.profiles.active=prod
|
|
|
|
|
|
@pause |