start.sh 579 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. # 浠艾福(CFC) 后端启动脚本
  3. # JVM 参数: G1GC, 512m初始堆, 2g最大堆
  4. # 用法: ./start.sh [--debug]
  5. DEBUG_FLAG=""
  6. if [ "$1" = "--debug" ]; then
  7. DEBUG_FLAG="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=5005,suspend=n"
  8. fi
  9. cd "$(dirname "$0")"
  10. exec java \
  11. $DEBUG_FLAG \
  12. -Xms512m \
  13. -Xmx2g \
  14. -XX:+UseG1GC \
  15. -XX:MaxGCPauseMillis=200 \
  16. -XX:+HeapDumpOnOutOfMemoryError \
  17. -XX:HeapDumpPath=/tmp/cfc-heapdump.hprof \
  18. -Dfile.encoding=UTF-8 \
  19. -Dspring.profiles.active=prod \
  20. -jar target/cfc-backend-1.0.0.jar