This is getting when i tried to download 150mb size file. i have JAVA_OPTS as following.
if [ -f /root/.rs850 -o -f /root/.rs851 -o -f /root/.rs950 -o -f /root/.rs951 ]
JAVA_OPTS="$JAVA_OPTS -Xmx1024m -XX:MaxPermSize=128m"
else
JAVA_OPTS="$JAVA_OPTS -Xmx512m -XX:MaxPermSize=128m"
It would appear that something in your webapp is buffering the big file in memory prior to it being downloaded by the user's web browser. (You can easily consume more memory than you would think, depending on the nature of the file and how it is being read and buffered in memory.)
There are two ways to address this:
Modify the code in your webapp that is responsible for serving up the file so that it doesn't need to buffer it in memory before sending it.
Increase the max heap size; e.g. change the -Xmx512
option to (say) -Xmx1024
.
Unfortunately, the second solution means that your Tomcat instance will use more memory. It is also a bandaid. If you need to download a larger file, you are liable to run into the same problem again.
Another possibility is that your webapp has a memory leak, and it was just a coincidence that the 150 Mb download triggered the OOME.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments