【发布时间】:2011-06-22 03:05:43
【问题描述】:
我或多或少地运行以下代码
http://download.oracle.com/javase/1.4.2/docs/guide/nio/example/Grep.java
我正在使用以下 VM 参数
-Xms756m -Xmx1024m
它在 400mb 文件上因 OutOfMemory 崩溃。我做错了什么?
堆栈跟踪:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.nio.HeapCharBuffer.<init>(Unknown Source)
at java.nio.CharBuffer.allocate(Unknown Source)
at java.nio.charset.CharsetDecoder.decode(Unknown Source)
at com.alluvialtrading.tools.Importer.<init>(Importer.java:46)
at com.alluvialtrading.tools.ReutersImporter.<init>(ReutersImporter.java:24)
at com.alluvialtrading.tools.ReutersImporter.main(ReutersImporter.java:20)
【问题讨论】:
标签: java out-of-memory