Tomcat6在Ubuntu中安装的时间间隔是崩溃的

我在Ubuntu操作系统中安装了Tomcat6,当我运行我的Web应用程序时,服务器每隔一段时间就会崩溃。 我已经尝试了很多,但没有得到解决scheme。 我已经增加了2048mb的内存,但仍然得到这样的错误。 以下是我得到的错误。 任何帮助将非常感激。

org.apache.tomcat.util.http.Parameters processParametersINFO: Invalid chunk starting at byte [312] and ending at byte [312] with a value of [null] ignoredException in thread "Timer-1" Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0" Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2" Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1" Exception in thread "Timer-2" Exception in thread "http-8080-4" Exception in thread "http-8080-8" Exception in thread "http-8080-17" Exception in thread "org.hibernate.cache.StandardQueryCache.data" Exception in thread "org.hibernate.cache.UpdateTimestampsCache.data" Exception in thread "org.hibernate.cache.StandardQueryCache.data" Exception in thread "org.hibernate.cache.StandardQueryCache.data" Exception in thread "org.hibernate.cache.UpdateTimestampsCache.data" Exception in thread "org.hibernate.cache.StandardQueryCache.data" Exception in thread "org.hibernate.cache.StandardQueryCache.data" Exception in thread "org.hibernate.cache.UpdateTimestampsCache.data" Exception in thread "com.safenet.usermgmt.User.data" Exception in thread "http-8080-7" Exception in thread "http-8080-12" Exception in thread "http-8080-16" Exception in thread "http-8080-14" Exception in thread "http-8080-13" Exception in thread "http-8080-15" Exception in thread "http-8080-6" OpenJDK Client VM warning: Exception java.lang.OutOfMemoryError occurred dispatching signal SIGTERM to handler- the VM may need to be forcibly terminated 

停止服务器,存档日志文件。 重新启动服务器。 发生exception时,发布完整的堆栈跟踪。 如果错误很长时间没有发生,您可能需要添加:

-XX:-OmitStackTraceInFastThrow

到您的CATALINA_OPTS。

检查你的应用程序是否正确closures了它在try / catch的finally块中使用的任何数据库连接。

如果启动了启用了jmxremote的Tomcat实例,则可以更轻松地确定任何问题。

将以下内容添加到Tomcat的CATALINA_OPTS环境variables中,然后重新启动JVM。

 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false 

完成之后,您可以使用jconsole监视内存使用情况并查找不寻常的趋势。 您的应用程序中可能会有严重的内存泄漏,导致此问题。