Page 1 of 1

OutOfMemoryError: Java heap space on downloading large file

Posted: Fri Aug 26, 2016 3:18 am
by mimos_user
I am getting the below in dms.log file:
java.lang.OutOfMemoryError: Java heap space

The RESTful api I have used is as below:

Code: Select all

curl -u admin:admin http://localhost:8080/services/rest/document/getContent?docId=3375104
The file I'm trying to download is size above 1 GB.

Is there any fix for this issue? Any workaround? Any best practices to avoid bumping into this exception?

Any suggestion will be highly appreciated. Thank you.

Re: OutOfMemoryError: Java heap space on downloading large f

Posted: Fri Aug 26, 2016 3:01 pm
by car031
in the bin/logicaldoc.sh locate the JAVA_OPTS variable, here increase the heap memopry, you could try with -Xmx4000m
Of course you have to restart LogicalDOC.

Re: OutOfMemoryError: Java heap space on downloading large f

Posted: Mon Aug 29, 2016 10:16 am
by mimos_user
car031 wrote:in the bin/logicaldoc.sh locate the JAVA_OPTS variable, here increase the heap memopry, you could try with -Xmx4000m
Of course you have to restart LogicalDOC.
Thank you for your suggestion. I couldn't try the above because the logicaldoc.bat didn't work on my machine. I didn't investigate further on that. But instead I just directly used the startup.bat in the ..\LogicalDOC-Community\tomcat\bin directory to start LogicalDoc.

But I did something similar as the suggestion. I create setenv.bat file in ..\LogicalDOC-Community\tomcat\bin with the below content in it.

Code: Select all

set JAVA_OPTS=-Dfile.encoding=UTF-8 -Xms4096m -Xmx4096m
Once restarted I could download 1 GB file from LogicalDoc :D