java中queue为什么有错误,线程"AWT-EventQueue-0"中的异常;java.lang.OutOfMemoryError:Java堆空间...

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space

at java.awt.image.DataBufferInt.(Unknown Source)

at java.awt.image.Raster.createPackedRaster(Unknown Source)

at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)

at java.awt.image.BufferedImage.(Unknown Source)

at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)

at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown Source)

at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown Source)

at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown Source)

at sun.java2d.pipe.DrawImage.blitSurfaceData(Unknown Source)

at sun.java2d.pipe.DrawImage.renderImageCopy(Unknown Source)

at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)

at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)

at sun.java2d.pipe.ValidatePipe.copyImage(Unknown Source)

at sun.java2d.SunGraphics2D.drawImage(Unknown Source)

Iam getting this error message when I load the Web start application from production.

When I load the same production code from eclipse, the above error "java.lang.OutOfMemoryError: Java heap space" disappear and everything works fine.

What could the reason, why it is working in eclipse and not in standalone.

-Pad

解决方案

Java's default heap size (at least last time I researched it) is 128 MB. The latest version of Eclipse (i.e. Helios) is set to run with a default heap size of 512 MB. (see the eclipse.ini file in your Eclipse base path).

Therefore, you are probably seeing this behavior because your application needs a heap size greater than 128 MB... which it doesn't get from your system JVM's defaults, but DOES get within the Eclipse JVM process.

In your Web Start ".jnlp" file, look for the first element, and add a max-heap-size attribute like this:

Reference

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值