简体   繁体   English

JVM在Java 6中被吊死了几秒钟

[英]JVM is getting hanged for few seconds in java 6

After upgrading our application(Mindalign) from jdk 1.4 to jdk 1.6 , it was found that JVM often gets hanged for few seconds. 将我们的应用程序(Mindalign)从jdk 1.4升级到jdk 1.6后,发现JVM通常会挂起几秒钟。

Observation: 观察:

During startup, Application does a lot of I/O operations (ie loading xml file, sending data to Tcp/Ip socket) There is a gap of around 2 second can be observed during these operations. 在启动过程中,Application会执行很多I / O操作(即,加载xml文件,将数据发送到Tcp / Ip套接字),在这些操作期间大约有2秒的间隔。

Given below is the sample logs during the issue. 下面给出的是发行期间的示例日志。

Compiled with JDK1.4 与JDK1.4一起编译

DEBUG 14Jan30 16:33:42108  digester.xml.AbstractDigestBinder/shutdown        | loading configuration: 
DEBUG 14Jan30 16:33:42218  gs.group_server.GroupServer/shutdown              | Maximum exception occurred within the timespan is set to 0

INFO  14Jan30 16:33:53153  rr.net.ConnectionManager/MessageHandler    | [IRC] << :groupserver. RPLWHOREG
INFO  14Jan30 16:33:53153  rr.net.ConnectionManager/MessageHandler    | [IRC] << :groupserver. RPLWHOREG


Compiled with JDK1.6

DEBUG 14Feb05 14:22:45801  digester.xml.AbstractDigestBinder/shutdown        | loading configuration: 
DEBUG 14Feb05 14:22:47205  gs.group_server.GroupServer/shutdown              | Maximum exception occurred within the timespan is set to 0

DEBUG 14Feb05 14:22:54599  rr.net.ConnectionManager/MessageHandler       | [IRC] << :groupserver. RPLWHOREG
DEBUG 14Feb05 14:22:56502  rr.net.ConnectionManager/MessageHandler                | [IRC] << :groupserver. RPLWHOREG

Please suggest me, how to troubleshoot this issue. 请建议我,如何解决此问题。 strong text 强文本

Can it be related with xms value (heap size) of java..? 它可以与java ..的xms值(堆大小)相关吗?

Use a profiler and/or VisualVM to look at what your application is doing. 使用事件探查器和/或VisualVM查看您的应用程序在做什么。

Turn on garbage collection debugging to see if there is anything going on there. 打开垃圾回收调试,以查看是否发生了任何事情。

Use a debugger to "pause" the application during one of these stalls and then investigate to see what it's doing or waiting for. 在其中一个停顿期间,使用调试器“暂停”应用程序,然后进行调查以查看其正在执行或正在等待的操作。

I don't actually see huge differences in the two timings though: 我实际上看不到这两个时间的巨大差异:

:42 to :53 is :11 difference, in the second case :47 to :54 is :07 difference. :42到:53是:11差异,在第二种情况下:47到:54是:07差异。 It's actually got faster...which is to be expected as the 1.6 JVM is smarter than the 1.4 one. 它实际上变得更快了……这是可以预料的,因为1.6 JVM比1.4 JVM更智能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM