- 浏览: 54259 次
- 性别:
- 来自: 深圳
最新评论
-
gdou_wzy:
在我的windowsXP上也出现了。
研究发现与搜狗输入法貌 ...
谁能告诉我JVM什么情况下崩溃会不产生hs_err_pid.log? -
ald:
???????
JetBrains IntelliJ IDEA 8.0 序列号 注册机 keygen -
huangyuanmu:
thx,终于找到了
JDK5 下载 -
fantasybei:
thx
JetBrains IntelliJ IDEA 8.0 序列号 注册机 keygen
From http://java.sun.com/javase/6/webnotes/trouble/other/matrix6-Unix.html
Quick Troubleshooting Tips on Solaris OS and Linux for Java SE 6
This "Quick Start Guide" gives you some quick tips for troubleshooting. The subsections list some typical functions that can help you in troubleshooting, including one or more ways to get the information or perform the action.
These tips are organized as follows:
Hung, Deadlocked, or Looping Process
Post-mortem Diagnostics, Memory Leaks
Monitoring
Actions on a Remote Debug Server
Other Functions
Hung, Deadlocked, or Looping Process
- Print thread stack for all Java threads:
- Control-\
- kill -QUIT pid
- jstack pid (or jstack -F pid if jstack pid does not respond)
- Detect deadlocks:
- Request deadlock detection: JConsole tool, Threads tab
- Print information on deadlocked threads: Control-\
- Print list of concurrent locks owned by each thread: -XX:+PrintConcurrentLocks set, then Control-\
- Print lock information for a process: jstack -l pid
- Get a heap histogram for a process:
- Start Java process with -XX:+PrintClassHistogram , then Control-\
- jmap -histo pid (with -F option if pid does not respond)
- Dump Java heap for a process in binary format to file:
- jmap -dump:format=b,file= filename pid (with -F option if pid does not respond)
- Print shared object mappings for a process:
- jmap pid
- Print heap summary for a process:
- Control-\
- jmap -heap pid
- Print finalization information for a process:
- jmap -finalizerinfo pid
- Attach the command-line debugger to a process:
- jdb -connect sun.jvm.hotspot.jdi.SAPIDAttachingConnector:pid= pid
Post-mortem Diagnostics, Memory Leaks
- Examine the fatal error log file. Default file name is hs_err_pid pid .log in the working-directory.
- Create a heap dump:
- Start the application with HPROF enabled: java -agentlib:hprof=file= file ,format=b application ; then Control-\
- Start the application with HPROF enabled: java -agentlib:hprof=heap=dump application
- JConsole tool, MBeans tab
- Start VM with -XX:+HeapDumpOnOutOfMemoryError ; if OutOfMemoryError is thrown, VM generates a heap dump.
- Browse Java heap dump:
- jhat heap-dump-file
- Dump Java heap from core file in binary format to a file:
- jmap -dump:format=b,file= filename corefile
- Get a heap histogram for a process:
- Start Java process with -XX:+PrintClassHistogram , then Control-\
- jmap -histo pid (with -F option if pid does not respond)
- Get a heap histogram from a core file:
- jmap -histo corefile
- Print shared object mappings from a core file:
- jmap corefile
- Print heap summary from a core file:
- jmap -heap corefile
- Print finalization information from a core file:
- jmap -finalizerinfo corefile
- Print Java configuration information from a core file:
- jinfo corefile
- Print thread trace from a core file:
- jstack corefile
- Print lock information from a core file:
- jstack -l corefile
- Attach the command-line debugger to a core file on the same machine:
- jdb -connect sun.jvm.hotspot.jdi.SACoreAttachingConnector:javaExecutable= path ,core= corefile
- Attach the command-line debugger to a core file on a different machine:
- On the machine with the core file: jsadebugd
path corefile
and on the machine with the debugger: jdb -connect sun.jvm.hotspot.jdi.SADebugServerAttachingConnector:debugServerName= machine
- On the machine with the core file: jsadebugd
path corefile
- libumem can be used to debug memory leaks.
Monitoring
Note: The vmID argument for the jstat command is the virtual machine identifier. See the jstat man page for a detailed explanation.
- Print statistics on the class loader:
- jstat -class vmID
- Print statistics on the compiler:
- Compiler behavior: jstat -compiler vmID
- Compilation method statistics: jstat -printcompilation vmID
- Print statistics on garbage collection:
- Summary of statistics: jstat -gcutil vmID
- Summary of statistics, with causes: jstat -gccause vmID
- Behavior of the gc heap: jstat -gc vmID
- Capacities of all the generations: jstat -gccapacity vmID
- Behavior of the new generation: jstat -gcnew vmID
- Capacity of the new generation: jstat -gcnewcapacity vmID
- Behavior of the old and permanent generations: jstat -gcold vmID
- Capacity of the old generation: jstat -gcoldcapacity vmID
- Capacity of the permanent generation: jstat -gcpermcapacity vmID
- Monitor objects awaiting finalization:
- JConsole tool, VM Summary tab
- jmap -finalizerinfo pid
- getObjectPendingFinalizationCount method in java.lang.management.MemoryMXBean class
- Monitor memory:
- Heap allocation profiles via HPROF: java -agentlib:hprof=heap=sites
- JConsole tool, Memory tab
- Control-\ prints generation information.
- Monitor CPU usage:
- By thread stack: java -agentlib:hprof=cpu=samples application
- By method: java -agentlib:hprof=cpu=times application
- JConsole tool, Overview and VM Summary tabs
- Monitor thread activity:
- JConsole tool, Threads tab
- Monitor class activity:
- JConsole tool, Classes tab
Actions on a Remote Debug Server
First, attach the debug daemon jsadebugd , then execute the command:
- Dump Java heap in binary format to a file: jmap -dump:format=b,file= filename hostID
- Print shared object mappings: jmap hostID
- Print heap summary : jmap -heap hostID
- Print finalization information : jmap -finalizerinfo hostID
- Print lock information : jstack -l hostID
- Print thread trace : jstack hostID
- Print Java configuration information: jinfo hostID
Other Functions
- Interface with the instrumented Java virtual machines:
- Monitor for the creation and termination of instrumented VMs: jstatd daemon
- List the instrumented VMs: jps
- Provide interface between remote monitoring tools and local VMs: jstatd daemon
- Request garbage collection: JConsole tool, Memory tab
- Print Java configuration information from a running process:
- jinfo pid
- Dynamically set, unset, or change the value of certain Java VM flags for a process:
- jinfo -flag flag
- Print command-line flags passed to the VM:
- jinfo -flags
- Print Java system properties:
- jinfo -sysprops
- Pass a Java VM flag to the virtual machine:
- jconsole -J flag ...
- jhat -J flag ...
- jmap -J flag ...
- Print statistics of permanent generation of Java heap, by class loader:
- jmap -permstat
- Report on monitor contention.
- java -agentlib:hprof=monitor=y application
- Evaluate or execute a script in interactive or batch mode:
- jrunscript
- Interface dynamically with an MBean, via JConsole tool, MBean tab:
- Show tree structure.
- Set an attribute value.
- Invoke an operation.
- Subscribe to notification.
- Run interactive command-line debugger:
- Launch a new VM for the class: jdb class
- Attach debugger to a running VM: jdb -attach address
<script src="http://java.sun.com/js/omi/jsc/s_code_remote.js"></script><script src="http://www-cdn.sun.com/share/metrics/metrics_group1.js"></script>
发表评论
-
谁能告诉我JVM什么情况下崩溃会不产生hs_err_pid.log?
2009-12-28 09:51 2307自己的服务已经出现过两次这种情况了,linux下的jvm进程悄 ... -
JProfiler 5.1 LicenseKey
2009-12-01 15:44 1833From http://serendipityspaces ... -
Understanding CMS GC Logs
2009-11-19 11:45 1425http://blogs.sun.com/poonam/ ... -
The most complete list of -XX options for Java 6 JVM
2009-11-19 11:43 1728http://www.cnblogs.com/totti198 ... -
Thread Management
2009-11-11 10:00 849From http://jikesrvm.org/Thread ... -
Tips About JDK5.0' Tool
2009-11-09 14:19 1284http://www.javaperformancetunin ... -
JDK5 下载
2009-10-21 09:14 1925Sun上下个JDK5还得注册,真是啰嗦,从这个地址进入不用再注 ... -
Java Debian Tuning
2009-08-26 09:35 944From JavaDebianTuning Debia ... -
Java Optimize Reference
2009-08-26 09:33 707Java SE 6 HotSpot[tm] Virt ... -
Out Of Memory Errors Refernece
2009-08-26 09:28 1563From: confluence OutOfMemory ... -
idea resource
2009-07-15 19:49 723------------------------------- ... -
Process multimedia with the JMF API
2008-05-10 19:56 3034REF: http://www.builderau.com.a ...
相关推荐
### Java SE 6与HotSpot VM故障排除指南关键知识点解析 #### 一、概述 《Java SE 6与HotSpot VM故障排除指南》是Oracle公司于2008年11月发布的一份技术文档,旨在帮助开发人员、系统管理员和技术支持人员解决在...
随着Java平台标准版(Java Platform, Standard Edition,简称Java SE)的发展与普及,软件开发者们面临的问题也日益复杂。为了确保应用程序能够在各种环境中稳定运行,熟练掌握调试技术变得尤为重要。本文将详细介绍...
Denise Kinsey introduce Linux with the primary goal of enforcing and troubleshooting security. Their practical approach will help you protect systems, even if one or more layers are penetrated. ...
To gain these benefits, however, team members need common troubleshooting skills and practices.In DevOps Troubleshooting: Linux Server Best Practices, award-winning Linux expert Kyle Rankin brings ...
The target audience for this publication includes IT professionals involved in the deployment, administration, and optimization of SAP BW systems running on DB2 UDB for z/OS. This includes DBAs, SAP ...
《Oracle Solaris 8 Solaris Common Messages and Troubleshooting Guide》是Oracle公司为Solaris 8操作系统提供的一份详尽的错误消息与故障排查指南。该文档由Sun Microsystems, Inc.于2000年2月发布,编号为806-...
Solaris Common Messages and Troubleshooting Guide.pdf
Java Virtual Machine Support for Non-Java Languages: Java SE 7 introduces a new JVM instruction that simplifies the implementation of dynamically typed programming languages on the JVM. Garbage-First...
A comprehensive guide to mastering the art of preventing your Linux system from getting ... Auditing and HardeningVulnerability Scanning and Intrusion DetectionSecurity Tips & Tricks for the Busy Bee
Designed for quick reference at any job site, the Electrician's Troubleshooting and Testing Pocket Guide enables electricians using portable meters to test, maintain, and troubleshoot all types of ...
Java SE 17 中的监控和管理工具和 API 都提供了故障排除和 Troubleshooting 功能,能够帮助开发者和管理员快速排除 Java 应用程序中的问题和错误。 Java SE 17 监控和管理指南提供了详细的信息和指南,帮助开发者和...
Java SE 监控和管理指南 Java SE 监控和管理指南是 Oracle 公司发布的一份关于 Java Platform, Standard Edition 的监控和管理指南。该指南旨在帮助开发者和管理员更好地了解 Java SE 平台的监控和管理机制,从而...
- **Troubleshooting**: Common issues and solutions related to secure OTA updates, including debugging tips and best practices. #### 5. Revision History The revision history section documents all ...
Title: Java EE 7 Performance Tuning and Optimization Author: Osama Oransa Length: 398 pages Edition: 1 Language: English Publisher: Packt Publishing Publication Date: 2014-06-25 ISBN-10: 178217642X ...
This book will traverse some common best practices to for complex application scenarios where troubleshooting can be successfully employed to provide the repeatable processes and advantages that ...
In this completely updated new edition of his best-selling guide, Homer Davidson gives you hands-on illustrated guidance on how to troubleshoot and repair a wide range of electronic products -- when ...