Ошибка утечки памяти при развертывании приложения Clojure Ring на Tomcat 8

Я пытаюсь развернуть кольцевое приложение войны на Tomcat 8. Создана война с 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 ответов

Другие вопросы по тегам