OutOfMemoryError: Java heap space on downloading large file

Do you want to create a native client or integrate with third party applications: webservices are the solution.

Moderator: car031

mimos_user
Posts: 2
Joined: Thu Aug 25, 2016 8:00 am

OutOfMemoryError: Java heap space on downloading large file

Fri Aug 26, 2016 3:18 am

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.
car031
Posts: 154
Joined: Tue Apr 17, 2012 8:27 am

Re: OutOfMemoryError: Java heap space on downloading large f

Fri Aug 26, 2016 3:01 pm

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.
mimos_user
Posts: 2
Joined: Thu Aug 25, 2016 8:00 am

Re: OutOfMemoryError: Java heap space on downloading large f

Mon Aug 29, 2016 10:16 am

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

Return to “Web Services”

Who is online

Users browsing this forum: No registered users and 18 guests