Java Web Start应用程序崩溃与OutOfMemoryError

时间:2023-01-19 15:45:52

I have extended a genomics viewer with some features requested by the Johns Hopkins Lab. When I run the app from the command-line I seem to have no memory problems - the app has been started with -Xmx750m. However, when I run the same app as a web-start app with the following heap settings:

我已经扩展了一个基因组学查看器,其中包含约翰霍普金斯实验室要求的一些功能。当我从命令行运行应用程序时,我似乎没有内存问题 - 该应用程序已启动-Xmx750m。但是,当我使用以下堆设置运行与web-start应用程序相同的应用程序时:

  <java initial-heap-size="67108864" max-heap-size="1205862400" version="1.5+"/>

after a while the app crashes with an OutOfMemoryError thus:

一段时间后,应用程序崩溃并出现OutOfMemoryError:

ERROR [2011-01-12 16:28:22,437]  [DefaultExceptionHandler.java:42] [AWT-EventQueue-0]  Unhandled exception
java.lang.OutOfMemoryError
 at java.util.zip.Inflater.init(Native Method)
 at java.util.zip.Inflater.<init>(Unknown Source)
 at java.util.zip.Inflater.<init>(Unknown Source)

There is no difference between the local app and web-start app except that I have signed the jars which are called out in the web-start jnlp file. I have tried to attach to the web-start app with both JConsole and YourKit Java profiler. In each case, I have turned on the HeapDumpOnOutOfMemoryError property by invoking the setVMOption operation of the HotSpotDiagnostic MBean; but when the app crashes, no heap dump is generated.

除了我已经签署了在web-start jnlp文件中调用的jar之外,本地应用程序和web-start应用程序之间没有区别。我试图用JConsole和YourKit Java Profiler连接到web-start应用程序。在每种情况下,我都通过调用HotSpotDiagnostic MBean的setVMOption操作来打开HeapDumpOnOutOfMemoryError属性;但是当应用程序崩溃时,不会生成堆转储。

It seems to me that the crash is related to running under web-start. I have tried very hard to cause an OutOfMemoryError on the desktop app - by reducing the memory (-Xmx250m); this causes the app to pause for long periods of time (as much as 5min) while presumably garbage collection is done. But the app always resumes after the pause - never crashes.

在我看来,崩溃与在web-start下运行有关。我已经非常努力地在桌面应用上引起OutOfMemoryError - 通过减少内存(-Xmx250m);这导致应用程序暂停很长一段时间(多达5分钟),而可能是垃圾收集完成。但该应用程序总是在暂停后恢复 - 永远不会崩溃。

Can anyone tell me of a way to capture a heap-dump on an OutOfMemoryError under web-start? Though, I suspect that I may not be actually running out of heap at all. But at least it would be a place to start.

谁能告诉我在web-start下捕获OutOfMemoryError上的堆转储的方法?虽然,我怀疑我可能根本没有用完堆。但至少它是一个开始的地方。

I am at my wit's end - any help would be greatly appreciated.

我在我的智慧结束 - 任何帮助将不胜感激。

I am running Java 1.6.0_20-b02 on Windows XP-SP2.

我在Windows XP-SP2上运行Java 1.6.0_20-b02。

2 个解决方案

#1


0  

I also saw this in my app. In my case it was caused by corrupted JARs. Try if the signed jars are still valid (try opening them in winzip or other zip tool - my favourite is CTRL+PGDOWN in TotalCommander ;-)

我也在我的应用程序中看到了这一点在我的情况下,它是由损坏的JAR引起的。尝试签名的罐子仍然有效(尝试在winzip或其他拉链工具中打开它们 - 我最喜欢的是TotalCommander中的CTRL + PGDOWN ;-)

#2


0  

I just fixed a very similar issue yesterday which I resolved by calling Deflater.end() (see this for some extra info). I was getting OutOfMemoryError exceptions during serialization, but for some reason only when deployed as a webstart -- I couldn't duplicate the problem in Eclipse or in an executable jar regardless of Xmx.

我昨天刚刚解决了一个非常类似的问题,我通过调用Deflater.end()解决了这个问题(请参阅此内容以获取更多信息)。我在序列化期间得到了OutOfMemoryError异常,但出于某种原因只在部署为webstart时 - 我无法在Eclipse或可执行jar中复制问题而不管Xmx。

#1


0  

I also saw this in my app. In my case it was caused by corrupted JARs. Try if the signed jars are still valid (try opening them in winzip or other zip tool - my favourite is CTRL+PGDOWN in TotalCommander ;-)

我也在我的应用程序中看到了这一点在我的情况下,它是由损坏的JAR引起的。尝试签名的罐子仍然有效(尝试在winzip或其他拉链工具中打开它们 - 我最喜欢的是TotalCommander中的CTRL + PGDOWN ;-)

#2


0  

I just fixed a very similar issue yesterday which I resolved by calling Deflater.end() (see this for some extra info). I was getting OutOfMemoryError exceptions during serialization, but for some reason only when deployed as a webstart -- I couldn't duplicate the problem in Eclipse or in an executable jar regardless of Xmx.

我昨天刚刚解决了一个非常类似的问题,我通过调用Deflater.end()解决了这个问题(请参阅此内容以获取更多信息)。我在序列化期间得到了OutOfMemoryError异常,但出于某种原因只在部署为webstart时 - 我无法在Eclipse或可执行jar中复制问题而不管Xmx。