java.lang.Error:“没有足够的存储空间来处理此命令”生成图像时
我正在 BEA Weblogic 9.2 上运行 Web 应用程序。直到最近,我们还在使用 JDK 1.5.0_04、JAI 1.1.2_01 和 Image IO 1.1。在某些情况下(我们从未弄清楚具体原因),当我们处理大图像(但不是那么大 - 几 MB)时,JVM 会崩溃,没有任何错误消息或堆栈跟踪或任何东西。这种情况在生产中并没有发生太多,但足以造成麻烦,最终我们能够重现它。
我们决定切换到 JRockit90 1.5.0_04,并且我们无法再在测试环境中重现该问题,因此我们认为我们已经解决了。然而现在,在应用程序服务器启动一段时间后,我们在图像操作期间开始收到错误消息“没有足够的存储空间来处理此命令”。例如:
java.lang.Error: Error starting thread: Not enough storage is available to process this command.
at java.lang.Thread.start()V(Unknown Source)
at sun.awt.image.ImageFetcher$1.run(ImageFetcher.java:279)
at sun.awt.image.ImageFetcher.createFetchers(ImageFetcher.java:272)
at sun.awt.image.ImageFetcher.add(ImageFetcher.java:55)
at sun.awt.image.InputStreamImageSource.startProduction(InputStreamImageSource.java:149)
at sun.awt.image.InputStreamImageSource.addConsumer(InputStreamImageSource.java:106)
at sun.awt.image.InputStreamImageSource.startProduction(InputStreamImageSource.java:144)
at sun.awt.image.ImageRepresentation.startProduction(ImageRepresentation.java:647)
at sun.awt.image.ImageRepresentation.prepare(ImageRepresentation.java:684)
at sun.awt.SunToolkit.prepareImage(SunToolkit.java:734)
at java.awt.Component.prepareImage(Component.java:3073)
at java.awt.ImageMediaEntry.startLoad(MediaTracker.java:906)
at java.awt.MediaEntry.getStatus(MediaTracker.java:851)
at java.awt.ImageMediaEntry.getStatus(MediaTracker.java:902)
at java.awt.MediaTracker.statusAll(MediaTracker.java:454)
at java.awt.MediaTracker.waitForAll(MediaTracker.java:405)
at java.awt.MediaTracker.waitForAll(MediaTracker.java:375)
at SfxNET.System.Drawing.ImageLoader.loadImage(Ljava.awt.Image;)Ljava.awt.image.BufferedImage;(Unknown Source)
at SfxNET.System.Drawing.ImageLoader.loadImage(Ljava.net.URL;)Ljava.awt.image.BufferedImage;(Unknown Source)
at Resources.Tools.Commands.W$zw(Ljava.lang.ClassLoader;)V(Unknown Source)
at Resources.Tools.Commands.getContents()[[Ljava.lang.Object;(Unknown Source)
at SfxNET.sfxUtils.SfxResourceBundle.handleGetObject(Ljava.lang.String;)Ljava.lang.Object;(Unknown Source)
at java.util.ResourceBundle.getObject(ResourceBundle.java:320)
at SoftwareFX.internal.ChartFX.wxvw.yxWW(Ljava.lang.String;Z)Ljava.lang.Object;(Unknown Source)
at SoftwareFX.internal.ChartFX.wxvw.vxWW(Ljava.lang.String;)Ljava.lang.Object;(Unknown Source)
at SoftwareFX.internal.ChartFX.CommandBar.YWww(LSoftwareFX.internal.ChartFX.wxvw;IIII)V(Unknown Source)
at SoftwareFX.internal.ChartFX.Internet.Server.xxvw.YzzW(LSoftwareFX.internal.ChartFX.Internet.Server.ChartCore;Z)LSoftwareFX.internal.ChartFX.CommandBar;(Unknown Source)
at SoftwareFX.internal.ChartFX.Internet.Server.xxvw.XzzW(LSoftwareFX.internal.ChartFX.Internet.Server.ChartCore;)V(Unknown Source)
at SoftwareFX.internal.ChartFX.Internet.Server.ChartCore.OnDeserialization(Ljava.lang.Object;)V(Unknown Source)
at SoftwareFX.internal.ChartFX.Internet.Server.ChartCore.Zvvz(LSoftwareFX.internal.ChartFX.Base.wzzy;)V(Unknown Source)
以前有人见过这样的事情吗?知道可能发生什么吗?
I am running a web application on BEA Weblogic 9.2. Until recently, we were using JDK 1.5.0_04, with JAI 1.1.2_01 and Image IO 1.1. In some circumstances (we never figured out exactly why), when we were processing large images (but not that large - a few MB), the JVM would crash without any error message or stack trace or anything. This didn't happen much in production, but enough to be a nuisance and eventually we were able to reproduce it.
We decided to switch to JRockit90 1.5.0_04 and we were no longer able to reproduce the problem in our test environment, so we thought we had it licked. Now, however, after the application server has been up for a while, we start getting the error message, "Not enough storage is available to process this command" during image operations. For example:
java.lang.Error: Error starting thread: Not enough storage is available to process this command.
at java.lang.Thread.start()V(Unknown Source)
at sun.awt.image.ImageFetcher$1.run(ImageFetcher.java:279)
at sun.awt.image.ImageFetcher.createFetchers(ImageFetcher.java:272)
at sun.awt.image.ImageFetcher.add(ImageFetcher.java:55)
at sun.awt.image.InputStreamImageSource.startProduction(InputStreamImageSource.java:149)
at sun.awt.image.InputStreamImageSource.addConsumer(InputStreamImageSource.java:106)
at sun.awt.image.InputStreamImageSource.startProduction(InputStreamImageSource.java:144)
at sun.awt.image.ImageRepresentation.startProduction(ImageRepresentation.java:647)
at sun.awt.image.ImageRepresentation.prepare(ImageRepresentation.java:684)
at sun.awt.SunToolkit.prepareImage(SunToolkit.java:734)
at java.awt.Component.prepareImage(Component.java:3073)
at java.awt.ImageMediaEntry.startLoad(MediaTracker.java:906)
at java.awt.MediaEntry.getStatus(MediaTracker.java:851)
at java.awt.ImageMediaEntry.getStatus(MediaTracker.java:902)
at java.awt.MediaTracker.statusAll(MediaTracker.java:454)
at java.awt.MediaTracker.waitForAll(MediaTracker.java:405)
at java.awt.MediaTracker.waitForAll(MediaTracker.java:375)
at SfxNET.System.Drawing.ImageLoader.loadImage(Ljava.awt.Image;)Ljava.awt.image.BufferedImage;(Unknown Source)
at SfxNET.System.Drawing.ImageLoader.loadImage(Ljava.net.URL;)Ljava.awt.image.BufferedImage;(Unknown Source)
at Resources.Tools.Commands.W$zw(Ljava.lang.ClassLoader;)V(Unknown Source)
at Resources.Tools.Commands.getContents()[[Ljava.lang.Object;(Unknown Source)
at SfxNET.sfxUtils.SfxResourceBundle.handleGetObject(Ljava.lang.String;)Ljava.lang.Object;(Unknown Source)
at java.util.ResourceBundle.getObject(ResourceBundle.java:320)
at SoftwareFX.internal.ChartFX.wxvw.yxWW(Ljava.lang.String;Z)Ljava.lang.Object;(Unknown Source)
at SoftwareFX.internal.ChartFX.wxvw.vxWW(Ljava.lang.String;)Ljava.lang.Object;(Unknown Source)
at SoftwareFX.internal.ChartFX.CommandBar.YWww(LSoftwareFX.internal.ChartFX.wxvw;IIII)V(Unknown Source)
at SoftwareFX.internal.ChartFX.Internet.Server.xxvw.YzzW(LSoftwareFX.internal.ChartFX.Internet.Server.ChartCore;Z)LSoftwareFX.internal.ChartFX.CommandBar;(Unknown Source)
at SoftwareFX.internal.ChartFX.Internet.Server.xxvw.XzzW(LSoftwareFX.internal.ChartFX.Internet.Server.ChartCore;)V(Unknown Source)
at SoftwareFX.internal.ChartFX.Internet.Server.ChartCore.OnDeserialization(Ljava.lang.Object;)V(Unknown Source)
at SoftwareFX.internal.ChartFX.Internet.Server.ChartCore.Zvvz(LSoftwareFX.internal.ChartFX.Base.wzzy;)V(Unknown Source)
Has anyone seen something like this before? Any clue what might be happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
马库斯·亚当斯(Marcus Adams)应该为此受到赞扬,但他的小建议是以评论的形式而不是答案的形式,所以我不能只是检查它。他向我指出了 这个示例来自另一个答案 就成功了。
查看 \System\CurrentControlSet\Control\Session Manager\SubSystem 的注册表设置,发现:SharedSection=1024,3072,512。由于这是一项服务(无头),我们更改了第三个数字。新值是 SharedSection=1024,3072,1024。自从几周前进行此更改以来,该问题没有再次出现。
Marcus Adams should get the credit for this, but his little advice was in the form of a comment not an answer, so I can't just check it. He pointed me to this example from another answer and that did the trick.
Looking at the registry setting for \System\CurrentControlSet\Control\Session Manager\SubSystem and found this: SharedSection=1024,3072,512. Since this was a service (headless) we changed the third number. The new value was SharedSection=1024,3072,1024. The problem has not recurred since making this change a few weeks ago.
这听起来可能与线程的堆栈空间不足有关。请参阅这篇文章 https://bugs.java.com/bugdatabase/view_bug?bug_id=4765019 。 JVM 有一个 -Xss 参数来控制堆栈大小,但如果超过它,听起来您可能会同时创建大量线程......
This sounds like it could be related to running out of stack space for your thread. See this post https://bugs.java.com/bugdatabase/view_bug?bug_id=4765019. The JVM has a -Xss argument to control the stack size, though if you're exceeding it, it sounds like you may be creating a whole lot of threads at once...
错误消息很可能是实话。所提到的存储空间是指硬盘空间吗?您确定您的磁盘未满。否则,您可能会耗尽某种内存,就像其他答案之一中提到的那样。我不确定 weblogic 或 jrockit,但是
SunOracle 的 jdk 有一个很好的工具,称为 jconsole,它允许您查看正在运行的应用程序发生了什么情况。它应该能够告诉您有关内存消耗等信息。(该工具使用 jms,因此甚至可能适用于其他 jdk)Most likely the error message is telling the truth. Either the storage mentioned refers to hard disk space? Are you sure your disks aren't running full. Otherwise you have probably run out of memory of some sort like mentioned in one of the other answers. I'm not sure about weblogic or jrockit but
SunOracle's jdk has a nice tool called jconsole that allows you to see what's going on with your running application. It should be able to tell you about the memory consumption etc. (The tool uses jms so might even work on the other jdk's)