根据配置参数的高度和宽度,我必须为数组int input[]
分配空间。初始化Array时出错:OutOfMemoryError
int input[]=new int[height * width]; //this is line no 538
其中一个配置的具有参数height=8192
和width=8192
。所以数组的大小变成67108864
。但是当我这样做,我得到OutOfMemoryError。
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at Test.main(Test.java:538)
我已经在eclipse和cygwin上运行这个程序,但我面临同样的问题。我认为这不是一个错误,也不是例外。我该如何纠正这一点?
什么是你的java运行配置?发生OutOfMemoryError的行并不重要。 – Markus 2012-03-30 05:00:28
请参阅我的评论[此问题](http://stackoverflow.com/a/9937250/1251613) – Markus 2012-03-30 05:05:49