yada icon indicating copy to clipboard operation
yada copied to clipboard

Yada may give out of memory exception (java.lang.OutOfMemoryError, OOM) when put under load

Open ivarref opened this issue 4 years ago • 0 comments

Hi,

and thanks for a fine library.

Our yada server had been running fine for a few years. Recently however it has started experiencing OOM (out of memory) errors. It turns out that io.aleph/dirigiste version 0.1.5 has a known and fixed memory leak and that the latest yada version depends on dirigiste 0.1.5:

$ git remote -v
origin	[email protected]:juxt/yada.git (fetch)
origin	[email protected]:juxt/yada.git (push)

$ git checkout tags/1.2.15.1 -b v1.2.15.1
Switched to a new branch 'v1.2.15.1'

$ lein deps :tree | grep -B1 dirigiste
 [aero "1.0.1" :exclusions [[org.clojure/clojure]]]
 [aleph "0.4.4" :scope "test" :exclusions [[org.clojure/clojure] [io.aleph/dirigiste]]]
--
 [manifold "0.1.7-alpha5" :exclusions [[org.clojure/clojure]]]
   [io.aleph/dirigiste "0.1.5"]

dirigiste has some other serious issues, such as swallowing exceptions. I think the safest way to solve this problem as of now and as a yada user, is to simply pass in a standard thread pool when starting the yada server:

(yada.yada/listener some-routes
                    {:host     some-host
                     :port     some-port
                     :executor (java.util.concurrent.Executors/newFixedThreadPool 256)})

Hope this helps someone experiencing similar issues.

ivarref avatar Aug 24 '21 08:08 ivarref