This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-14
Channels
- # announcements (7)
- # aws (1)
- # babashka (1)
- # beginners (19)
- # calva (9)
- # clj-commons (4)
- # clj-kondo (64)
- # clj-on-windows (27)
- # cljsrn (12)
- # clojure (127)
- # clojure-bay-area (3)
- # clojure-europe (25)
- # clojure-hungary (7)
- # clojure-nl (1)
- # clojure-norway (9)
- # clojure-spec (5)
- # clojure-survey (2)
- # clojure-uk (22)
- # community-development (5)
- # core-async (19)
- # cursive (29)
- # datascript (8)
- # events (1)
- # fulcro (2)
- # graalvm (3)
- # jobs (1)
- # lsp (155)
- # malli (18)
- # nbb (6)
- # off-topic (86)
- # pathom (2)
- # rdf (18)
- # re-frame (9)
- # releases (2)
- # scittle (24)
- # shadow-cljs (33)
- # xtdb (4)
I have a service with a huge memory leak. After analyzing the heap dump I see it all ties back to timeouts in alts. Is it fixed in the latest version of core async? Any workarounds or mitigations? I remember seeing a few Jiras about it
There is an outstanding issue about head holding of closed over values, but that’s not directly tied to timeouts
Can you explain more about what you’re seeing?
And are you using the latest version or something older? 1.5.640 fixed an issue with clearing alt handlers
In systems with callbacks in java, timers can often be a source of leaks, because the inversion of control plus timers being a global resource means a timer is a strong reference to whatever data until it expires, and core.async doesn't remove timers when they are not chosen by an alt, it just marks them as cancelled
I can't explain it succinctly and I don't have the heap dump at hand, if you'd like I could probably share it with you. When you analyze it with Eclipse MAT it points to the synchronized queue behind timers at the dominating object which holds all the references in the heap
I am perfectly happy to blame the issue laid out in async-234 for any leaks in a program that uses core.async without any more evidence (I reported it and wrote the patches)
At work we had a lot of trouble with memory leaks in our project that heavily uses core.async and I ended up reducing our direct usage of timeouts. This was all a year or two before I figured out async-234(reducing timer usage was a wild guess "what is global and could be holding a ref?!"), so hard to definitively say.