#!/bin/sh
nohup java -server -Xmx128m -Xms128m -XX:MetaspaceSize=20m \
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=oom.dump \
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.port=9900 \
-Dcom.sun.management.jmxremote.rmi.port=9900 \
-Djava.rmi.server.hostname=192.168.2.123 \
-Duser.timezone=GMT+08 \
-jar app-0.0.1-SNAPSHOT.jar \
> app.log 2>&1 &
jmxremote 远程监控
agentlib:jdwp 远程调试