2013-10-26 25 views
0

如您所知,couchDB要求字節數組存儲文件。把一個79MB的文件放入couchDB,然後內存不足

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

然後我得到一個異常。

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.io.ByteArrayOutputStream.(ByteArrayOutputStream.java:60) at com.erp.util.CouchTest.getBytesFromFile(CouchTest.java:47)

如何將大尺寸文件放入字節數組中?

回答

1

看來這與CouchDB無關,只是JVM的大小問題。我建議看一看How can I increase the JVM memory?

+0

你說得對,它調整了JVM的大小後運行良好。 –