Fork me on GitHub
#cider
<
2022-01-30
>
Christopher Genovese04:01:19

I'm running a Clojurescript repl in CIDER (using shadow-cljs) and every session over the past few months eventually hangs. It starts with small delays on response that quickly grow longer and longer until it fully hangs. Sometimes it takes days before this occurs and sometimes it takes minutes. I went a week without a problem recently and then had to re-jack in six times in the past hour. This does not seem to happen when I run the shadow-cljs repl in a terminal, though to be honest I haven't done that nearly as much as I miss cider when I do. Still, this is an increasingly frustrating problem. I've monitored the nrepl messages but see nothing obvious, and there are no errors or otherwise showing up. When it starts to hang, even just entering 1 at the repl takes increasingly long, a few seconds at first and quickly ramping up. The only association I've seen is that it is more likely to occur when I call pprint. (The pretty printing by default is not working for me at all, so I sometimes call pprint to look at complicated data.) But this connection does not fully explain what's happening as it frequently does occur even when I don't print anything. I'd very much appreciate any advice or ideas. I'm not sure how to track down the problem. I'm running CIDER 1.2.0snapshot, Emacs 28.0.60, on Mac OS X 10.14.5. I've been using CIDER for a long time without this problem, and I don't see what has changed recently. Thanks!

vemv05:01:29

might be a memory leak?

vemv05:01:03

not sure if you are used to something like Yourkit. It tends to be a good idea to always attach it beforehand to your JVM process, so that you can see the full history of memory usage (as a graph) controlling the "agent" (yourkit or some other) is easier if you launch the repl yourself from the terminal, i.e. favor cider-connect* over cider-jack-in*

vemv05:01:44

other than that this doesn't ring a bell, I've heard of various shadow-cljs issues but nothing like this one. By any chance your own application code could be responsible for the leak? Look for anything that accumulates state (`def` , memoize ...) Will take a quick look across our codebase but most likely without you going through Yourkit/etc it will be nearly impossible to debug

Christopher Genovese16:01:42

Thanks, that's very helpful. I haven't used yourkit but it sounds like a good idea. I'll also look out for possible leaks in the code. For a while I thought it was tap>'s which I've been using frequently, but I reset that state frequently. Thanks again.

fenton18:07:38

you still get cider if you cider-connect-cljs to your shadow terminal?