java相关命令

1.compile

javac -cp .:../build/:../../lib/jelly_blast.jar:/opt/tomcat-hidden/hidden/WEB-INF/lib/jackson-mapper-lgpl-1.6.4.jar:/opt/tomcat-hidden/hidden/WEB-INF/lib/jackson-core-lgpl-1.6.4.jar MongoLoadTesting.java

2.execute

java -cp .:../build/:../../lib/jelly_blast.jar:/opt/tomcat-hidden/hidden/WEB-INF/lib/jackson-mapper-lgpl-1.6.4.jar:/opt/tomcat-hidden/hidden/WEB-INF/lib/jackson-core-lgpl-1.6.4.jar MongoLoadTesting

3.tunning

java -XX:+UseG1GC -Xms10g -Xmx10g -cp .:jar/jelly_blast.jar:jar/jackson-mapper-lgpl-1.6.4.jar:jar/jackson-core-lgpl-1.6.4.jar:jar/cglib-2.2.jar:jar/asm-3.1.jar MongoLoadTestingMultiThreads1 splitLog.aa 60 172.31.32.2(选择GC,设置最小堆,设置最大堆)

4.hprof

java -agentlib:hprof=heap=sites,depth=20  -cp .:jar/jelly_blast.jar:jar/jackson-mapper-lgpl-1.6.4.jar:jar/jackson-core-lgpl-1.6.4.jar:jar/cglib-2.2.jar:jar/asm-3.1.jar MongoLoadTestingMultiThreads1 splitLog.aa 15 172.31.32.2(输出内存使用排名及堆栈信息)

5.jstat

jstat -gcutil 20042 1000 1000(每隔1000秒,打印一次gc信息)

6.jmap

jmap -heap 20042

7.jstack

jstack 20042 (结合top -Hp中的pid和jstack中的nid,查找热点线程)

你可能感兴趣的:(java相关命令)