在tomcat 8上部署clojure环应用程序时出现内存泄漏错误

时间:2016-03-14 11:34:51

标签: postgresql tomcat memory-leaks clojure korma

我试图在tomcat上部署一个响铃战争。用lein ring uberwar创建战争。

我怀疑这是因为jdbc连接线程但不确定。

我正在使用 [org.postgresql/postgresql "9.4-1206-jdbc42"][korma "0.4.1"]

project.clj

  :ring {:handler hello-world.handler/app
         :init    hello-world.handler/init
         :destroy hello-world.handler/destroy}

handler.clj

(korma.db/defdb db (korma.db/postgres {:db "hello_world"
                                       :user "user"
                                       :password "password"
                                       :host "localhost"}))

(defn init []
  (println "Init..."))

(defn destroy []
  (-> (korma.db/connection-pool db) :datasource .close))

这是来自tomcat日志的错误跟踪 -

org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/hello-world-0.1.0-SNAPSHOT-standalone.war
org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/hello-world-0.1.0-SNAPSHOT-standalone] startup failed due to previous errors
org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/hello-world-0.1.0-SNAPSHOT-standalone] appears to have started a thread named [clojure-agent-send-off-pool-0] but has failed to stop it. This is very likely to create a memory leak.
org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/hello-world-0.1.0-SNAPSHOT-standalone] appears to have started a thread named [clojure-agent-send-off-pool-1] but has failed to stop it. This is very likely to create a memory leak.
org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/hello-world-0.1.0-SNAPSHOT-standalone] created a ThreadLocal with key of type [clojure.lang.Var$1] (value [clojure.lang.Var$1@3a2ddd4f]) and a value of type [clojure.lang.Var.Frame] (value [clojure.lang.Var$Frame@191c8b60]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/hello-world-0.1.0-SNAPSHOT-standalone] created a ThreadLocal with key of type [clojure.lang.Var$1] (value [clojure.lang.Var$1@3a2ddd4f]) and a value of type [clojure.lang.Var.Frame] (value [clojure.lang.Var$Frame@21025881]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

0 个答案:

没有答案