无法使用 jvisualvm 分析 JBoss 5
我收到了一些 java.lang.OutOfMemoryError:超出 GC 开销限制
过夜运行 Java 应用程序时出现错误:
java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid6376.hprof ...
Heap dump file created [512149941 bytes in 23.586 secs]
23:34:52,163 WARN [HDScanner] Scan failed
java.lang.OutOfMemoryError: Java heap space
23:34:52,298 ERROR [ContainerBase] Exception invoking periodic operation:
java.lang.OutOfMemoryError: Java heap space
23:34:52,321 ERROR [JIoEndpoint] Socket accept failed
java.lang.OutOfMemoryError: Java heap space
at java.net.ServerSocket.accept(Unknown Source)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310)
如果我打开 jvisualvm,我可以看到我确实超出了堆空间:
我想对其进行分析以尝试找出发生了什么 - 是否存在内存泄漏?等但是,我根本无法让 jvisualvm 分析器执行任何操作。 Profiler
选项卡显示有关启用类共享的警告:
...即使我添加了 -Xshare:off
标志到我的虚拟机参数:
那么,
- 关于如何进行分析工作有什么想法吗?
- 是否值得使用
G1GC
而不是...我当前使用的任何 GC?
I've been getting some java.lang.OutOfMemoryError: GC overhead limit exceeded
errors while running my Java app overnight:
java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid6376.hprof ...
Heap dump file created [512149941 bytes in 23.586 secs]
23:34:52,163 WARN [HDScanner] Scan failed
java.lang.OutOfMemoryError: Java heap space
23:34:52,298 ERROR [ContainerBase] Exception invoking periodic operation:
java.lang.OutOfMemoryError: Java heap space
23:34:52,321 ERROR [JIoEndpoint] Socket accept failed
java.lang.OutOfMemoryError: Java heap space
at java.net.ServerSocket.accept(Unknown Source)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310)
If I open up jvisualvm, I can see that I am indeed out of heap space:
I'd like to profile it to try to figure out what's going on - is there a memory leak? etc. However, I'm unable to get the jvisualvm profiler to do anything at all. The Profiler
tab shows a warning about class sharing being enabled:
...even though I've added the -Xshare:off
flag to my VM args:
So,
- Any ideas about how to get profiling to work?
- Is it worth playing around with
G1GC
instead of ...whatever GC I'm currently using?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我看来,您在 32 位 JVM 上运行 VisualVM,而您的 JBoss 在 64 位 JVM 上运行。在这种情况下,分析器以及线程和 CPU 监控等其他功能在 Windows 上无法立即运行。使用分析器时,您会遇到错误 #273,其中分析器未正确启用。您应该执行以下操作:
It looks to me that you are running VisualVM on 32-bit JVM and your JBoss is running on 64-bit JVM. In such situation profiler and other things like Threads and CPU monitoring does not work on Windows out of the box. With profiler you are running into bug #273, where profiler is incorrectly enabled. You should do the following: