如何收集 Java 1.4 应用程序的分析信息?
我支持的在 JRE 1.4.2_12 上运行的 Java 应用程序每晚午夜附近都会挂起。 我想尝试记录尽可能多的分析信息,以发现 JVM 中或应用程序外部是否存在问题。
我想使用 HPROF 收集尽可能多的信息。
- 有没有办法让 HPROF 每分钟转储一次其 cpu 样本和内存分配报告,而不是在 JVM 终止时转储?
- 是否有一个不同的、更合适的分析器可以收集这样的信息?
A Java application I support that runs on JRE 1.4.2_12 is hanging near midnight every night. I'd like to try and record as much profiling information as I can to discover if there is an issue in the JVM or external to the app.
I'd like to use HPROF to collect as much information as possible.
- Is there a way to have HPROF dump its cpu sample and memory allocation report every minute instead of at the termination of the JVM?
- Is there a different, more appropriate profiler that can collect information like this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不会依赖转储文件,而是尝试将分析器连接到虚拟机并保持连接状态,直到发生挂起。 然后使用探查器来检查线程的状态。
Java 1.4 的使用在这里是一个小问题,因为 1.4 的调试界面不是很好,但一些分析器仍然支持它。 我特别推荐 YourKit,它是商业的,但提供评估许可证。 这是我用过的最好的分析器,但还有一些余量。
Rather than relying on dump files, I would try hooking up a profiler to the VM and leave it attached until the hang up occurs. Then use the profiler to introspect the state of the threads.
The use of Java 1.4 is a minor issue here, since 1.4's debug interface is not great, but some profilers still support it. I can particularly recommend YourKit, which is commercial, but offers an evaluation licence. It's the best profiler I've used, but some margin.
首先,您是否在应用程序挂起时分析了线程转储? 很多时候,有足够的信息来解决挂起的 java 应用程序...
Windows 上进程窗口中的
Ctrl-Break
或kill -QUIT [pid]
Linux。First things first: did you analyze the thread dump when your application hangs? A lot of the time that has enough information to troubleshoot a hanging java app...
Ctrl-Break
in the process window on Windows, orkill -QUIT [pid]
on Linux.我首先会尝试确定它是否确实是您的应用程序或其他应用程序。
盒子上是否还有其他应用程序,如果有,它们会在午夜左右运行任何批次。 这可能是您的应用程序由于盒子上运行的其他东西或占用带宽而缺乏资源的情况。
这种情况是一直都是这样还是最近才开始出现的? 如果这是新的,请看看整个盒子上发生了什么变化,而不仅仅是您自己的应用程序。
I would first try to determine if its actually your app or something else.
Are there any other apps on the box, if so do they run any batch around midnight. It could be a situation of your app suffering from a lack of resources due to other things running on the box or chewing up bandwidth.
Was this always the case or did it start recently. If this is new look at what changed on the box as a whole not just your own app.