JVM-相关工具
配置 jmx
在 jvm 启动的时候添加以下参数
1 | JAVA_OPTS="-Dcom.sun.management.jmxremote=true |
使用 jmx 连接远程机器时,需要关闭防火墙
1 | 1) 临时生效,重启后复原 |
配置远程调试
1 | -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=60001 |
查看对象占用情况
1 | ## 查看内存使用情况 |
jvm 参数
堆的总大小和可用堆的比例
MinHeapFreeRatio
MaxHeapFreeRatio
jdk 工具
$. 参考
- Monitoring and Management Using JMX Technology
- Java SE Monitoring and Management Guide
- Java Platform Standard Edition 7 Documentation
- Monitoring and Management for the Java Platform
- Java HotSpot VM Options
- java常用选项
- Java™ Virtual Machine Technology
- Non-standard Java HotSpot VM Options
- Java SE 6 HotSpot™ Virtual Machine Garbage Collection Tuning
- Troubleshooting Guide for Java SE 6 with HotSpot VM
- Troubleshooting Guide for HotSpot VM
- Java heap dump error with jmap command : Premature EOF