@echo off


REM 查找并终止运行中的 ff-admin.jar 进程
for /f "tokens=1" %%i in ('jps ^| findstr ff-admin.jar') do (
    echo 正在终止进程 ID %%i
    taskkill /PID %%i /F
)

REM 启动新进程
echo 启动 ff-admin.jar...
start /b java ^
    -XX:+PrintGCDetails -XX:+PrintGCDateStamps ^
    -Xloggc:/opt/sever/dist/ff-admin/gc.log ^
    -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/sever/dist/ff-admin/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=5005  ^
    -jar /opt/sever/dist/ff-admin/ff-admin.jar  ^
    --spring.profiles.active=prod    ^


