线上Java系统的调试经验一则
2010-11-17 21:09
162 查看
当系统已经上线,如果出现任何问题如何调试呢?正在运行的系统是不可能加入debug的参数的,一旦停止就会造成当前的数据破坏,也无从查找问题。
以Linux环境为例,如果直接是在命令行运行程序的,直接按Ctrl+\ 就可以看到了,如果是后台运行的,输入Kill -3 PID ,然后到输出的标准日志里面就会有。
非常不错的功能,当时发现有问题就可以多了一种有效的方式去发现问题,再也不用重新开一个debug模式运行的应用,直到等问题重现才知道什么情况,汗~~~。如果有兴趣就深入看一下thread dump的东西。
最后补充一下,mbean的方式也可以,有空研究一下。
原文:
Run the program from the command prompt and when the CPU peaks take a thread dump. You can get a thread dump by pressing the following at the command prompt: Ctrl+\ for unices or Ctrl+Break for windows machines. If you are running your application as a back ground process in unix, you could execute DE>kill -SIGQUIT <pid>DE> from another command prompt. The above signals the VM to generate a full thread dump. Sun’s VM prints the dump on the error stream while IBM’s JDK generates a new file with the thread dump every time you send the signal.
参考文献:
http://www.0xcafefeed.com/2004/06/of-thread-dumps-and-stack-traces/
http://lzmhehe.javaeye.com/blog/335526
以Linux环境为例,如果直接是在命令行运行程序的,直接按Ctrl+\ 就可以看到了,如果是后台运行的,输入Kill -3 PID ,然后到输出的标准日志里面就会有。
非常不错的功能,当时发现有问题就可以多了一种有效的方式去发现问题,再也不用重新开一个debug模式运行的应用,直到等问题重现才知道什么情况,汗~~~。如果有兴趣就深入看一下thread dump的东西。
最后补充一下,mbean的方式也可以,有空研究一下。
原文:
Run the program from the command prompt and when the CPU peaks take a thread dump. You can get a thread dump by pressing the following at the command prompt: Ctrl+\ for unices or Ctrl+Break for windows machines. If you are running your application as a back ground process in unix, you could execute DE>kill -SIGQUIT <pid>DE> from another command prompt. The above signals the VM to generate a full thread dump. Sun’s VM prints the dump on the error stream while IBM’s JDK generates a new file with the thread dump every time you send the signal.
参考文献:
http://www.0xcafefeed.com/2004/06/of-thread-dumps-and-stack-traces/
http://lzmhehe.javaeye.com/blog/335526
相关文章推荐
- 快速定位java系统的线上问题--转
- 使用oracle的系统跟踪功能调试java程序
- 线上系统查看java进程是如何被杀掉的
- 黑马程序员_java_银行业务调试系统
- 系统调试经验
- 黑马程序员__JAVA项目分析__银行业务调试系统
- java线上调试小结
- 黑马程序员————java7K高薪——银行业务调试系统
- DOMINO系统下java代理调试连接DB2服务器
- java线上编程挑战系统的输入和输出详细说明
- Java WEB系统国际化经验总结
- 今天线上系统碰到个怪问题DBCP数据连接异常,java.sql.SQLException: Already closed.
- 调试经验-java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@localhost:1521:orcl
- 使用Keil C调试某系统时积累的一些经验
- 因酷Java版开源网校系统,轻松实现线下到线上的转变
- linux类系统Ubuntu,deepin等下geany Java编程配置,错误调试
- [调试经验2] 常见java_sql_SQLException异常汇总
- (转)Java服务化系统线上应急和技术攻关,你必须拥有的那些应用层脚本和Java虚拟机命令
- 嵌入式系统调试经验(1)
- Yarn平台下出现java.lang.ArithmeticException:/ by zero 该异常的调试经验