This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-20
Channels
- # announcements (5)
- # aws (15)
- # babashka (12)
- # beginners (87)
- # calva (13)
- # cider (16)
- # clj-kondo (4)
- # clojure (22)
- # clojure-argentina (1)
- # clojure-europe (9)
- # clojure-houston (1)
- # clojure-nl (2)
- # clojure-norway (25)
- # clojure-uk (5)
- # clojurescript (12)
- # core-typed (37)
- # cursive (15)
- # datomic (40)
- # editors (8)
- # emacs (4)
- # events (1)
- # hyperfiddle (29)
- # keechma (8)
- # leiningen (6)
- # lsp (7)
- # malli (25)
- # off-topic (26)
- # pathom (10)
- # portal (3)
- # re-frame (22)
- # reitit (1)
- # releases (1)
- # ring (2)
- # shadow-cljs (18)
- # yamlscript (1)
I’m having a problem where I have a TON of logs being printed in my Cursive REPL session, and IntelliJ starts grinding to a halt. At first, I thought this was the REPL JVM process that was getting bogged down in GC…. But I’m now pretty sure it’s IntelliJ. I think the problem is that the REPL window is saving all the history, and it’s not purging the history when it starts running low on memory. I get the “spinning ball” on macOS, to the point where I can’t even take a screenshot. And oops! IntelliJ just crashed, before I could take a screenshot. Is there a way to set a limit on the REPL history, or whatever, to have it maintain memory for useful things, and prevent crashes? Thank you!! (I thought I configured IntelliJ use more heap space. Setting it to 5GB.)
IntelliJ becomes so unresponsive that it screen updates become very sluggish (one frame every 30 seconds), and it won’t process mouse events.
And so I can’t manually press the “force GC” area in the lower-right hand corner. PS: Using JetBrains AI Assistant to write commit messages is 🔥 🔥 . IMHO, it’s worth the $8/month just to get that — for everything else, I use GitHub Copilot.
FWIW, here’s a video screencast of this happening in real-time, as logs take more and more memory, IntelliJ becomes less reponsive, etc. Manual GC triggered at 2m 15s after clearing REPL output, which rescues the situation. 🙂 (Maybe not worth watching after that. I was figuring out how to change some of the internal Fulcro RAD logging.)
You can set the REPL history limit at Settings | Languages & Frameworks | Clojure | REPL Options, but I’d be surprised if that was the problem, the default is only 100 items.
I have to go out this morning, but I’ll look at this later on. Could you send me a copy of your log, probably to <mailto:[email protected]|[email protected]> would be best. Help | Show log in Finder
Is it the # of highlighted lines? (what is that?). Mine is set to 10,000. Thanks, @U0567Q30W!!
(And I just calculated what was potentially being printed out — it’s a 378 MB map when pr-str
. Which was definitely larger than I thought it’d be. 🙂
If the number of lines in the editor is a problem, you can just clear that with the trashcan action.
Which might explain how a couple of browser reloads blew up IntelliJ. 🙂 (What the video shows is that IntelliJ becomes very unresponsive, and often trashcan button never responds because entire IDE is frozen.)
Sorry, got to get my kid to a thing, will explain more later and look in detail at what you sent.
So, I misunderstood what you meant by history. The REPL history size is the number of previous commands that will be stored, not the output history. The number of highlighted lines is closer to what you wanted, having a massive history all highlighted also caused slowdowns, so now Cursive deletes highlighters past the last 10k lines. But there isn’t an option to limit the total size, unfortunately.
I will soon (like, next release) be switching the REPL output to use built-in IntelliJ component rather than a homegrown one, and it’s entirely possible that it will perform better in these sorts of edge cases, but I’m not sure yet.
Super — thanks for the explanation! I’ve had this problem a couple of times, and this one was interesting, because the logging was happening in a library outside of my control. It was actually interesting to have the Live CPU/Memory window up, to see the memory being allocated by IntelliJ. FWIW, in the ideal, it would be amazing to be able to set some sort of upper bound in terms of memory use, instead of lines. The single log statement that generated 100MB+ of text each time a query happened was genuinely surprising, eventually crashing IntelliJ was genuinely surprising. Catch you soon!