java.lang.OutOfMemoryError: Java heap space type Exception report problem
java預設的heap space只有128mb,導致web服務產生錯誤。
解決方法(ubuntu):
新增 /usr/share/tomcat7/bin/setenv.sh檔案,內容視情況調整,
範例:JAVA_OPTS="-Xms256M -Xmx768M"
chmod 755 setenv.sh
其他資料可以參考:
/usr/share/tomcat7/bin/catalina.sh
2016/12/14補充
也可以修改此檔/etc/default/tomcat8
JAVA_OPTS="-Djava.awt.headless=true -Xms256m -Xmx768m -XX:+UseConcMarkSweepGC"
reference
How to fix out of memory errors by increasing available memory
https://confluence.atlassian.com/confkb/how-to-fix-out-of-memory-errors-by-increasing-available-memory-154071.html
Tomcat 產生OutOfMemoryError
http://blog.xuite.net/keanuhome/blog/56035165-Tomcat+%E7%94%A2%E7%94%9FOutOfMemoryError
解決方法(ubuntu):
新增 /usr/share/tomcat7/bin/setenv.sh檔案,內容視情況調整,
範例:JAVA_OPTS="-Xms256M -Xmx768M"
chmod 755 setenv.sh
其他資料可以參考:
/usr/share/tomcat7/bin/catalina.sh
2016/12/14補充
也可以修改此檔/etc/default/tomcat8
JAVA_OPTS="-Djava.awt.headless=true -Xms256m -Xmx768m -XX:+UseConcMarkSweepGC"
reference
How to fix out of memory errors by increasing available memory
https://confluence.atlassian.com/confkb/how-to-fix-out-of-memory-errors-by-increasing-available-memory-154071.html
Tomcat 產生OutOfMemoryError
http://blog.xuite.net/keanuhome/blog/56035165-Tomcat+%E7%94%A2%E7%94%9FOutOfMemoryError
留言
張貼留言