run.sh # 启动入口类,该脚本文件用于别的项目时要改这里 MAIN_CLASS=common.MainConfig COMMAND="$1" if [[ "$COMMAND" != "start" ]] && [[ "$COMMAND" != "stop" ]] && [[ "$COMMAND" != "restart" ]]; then echo "Usage: $0 start | stop | restart" exit 0 fi # 生成 class path 值 APP_BASE_PATH=$(cd `dirname $0`; pwd) CP=${APP_BASE_PATH}/config:${APP_BASE_PATH}/lib/* function start() { # 运行为后台进程,并在控制台输出信息 java -Xmx4500m -Xms4500m -Xverify:none ${JAVA_OPTS} -cp ${CP} ${MAIN_CLASS} & } function stop() { # 支持集群部署 kill `pgrep -f ${APP_BASE_PATH}` 2>/dev/null } if [[ "$COMMAND" == "start" ]]; then start elif [[ "$COMMAND" == "stop" ]]; then stop else stop start fi
在start时,配置了jvm参数,-Xmx4500m -Xms4500m,但是再次执行 ./run.sh restart 命令时,抛出异常:
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006a6c00000, 3145728000, 0) failed; error='Cannot allocate memory' (errno=12) # # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (mmap) failed to map 3145728000 bytes for committing reserved memory.
请问如何处理?
项目:JFinal