将79MB文件放入couchDB,然后内存不足

时间:2013-10-26 00:39:47

标签: couchdb bytearray out-of-memory

如您所知,couchDB要求使用字节数组来存储文件。

ByteArrayOutputStream out = new ByteArrayOutputStream((int) file.length());

然后我得到了一个例外。

  

线程“main”中的异常java.lang.OutOfMemoryError:Java堆空间       在java.io.ByteArrayOutputStream。(ByteArrayOutputStream.java:60)       在com.erp.util.CouchTest.getBytesFromFile(CouchTest.java:47)

如何将大尺寸文件放入字节数组?

1 个答案:

答案 0 :(得分:1)

这似乎与CouchDB无关,只是JVM大小的问题。我建议您查看How can I increase the JVM memory?