This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Hi. When running lein repl :headless :host 127.0.0.1 :port 7888 and cider-connecting to it, I'm observing a gradual degradation of my emacs gc performance. This degradation also worsens the overall emacs performance to the point of caret hiccups during source code editing. Running (garbage-collect) manually reports:
((conses 16 5948358 2145018)
(symbols 48 38825 1407)
(strings 32 2983633 354261)
(string-bytes 1 27167350)
(vectors 16 81894)
(vector-slots 8 2161338 2199718)
(floats 8 994 2718)
(intervals 56 741518 5027)
(buffers 984 23))
... done (0.320s)
Closing the cider-repl buffer solves the problem:
((conses 16 776188 3985051)
(symbols 48 38825 1407)
(strings 32 235051 116892)
(string-bytes 1 6535738)
(vectors 16 73567)
(vector-slots 8 2100295 946825)
(floats 8 853 2859)
(intervals 56 6263 20202)
(buffers 984 21))
... done (0.086s)
and makes emacs smooth again. It looks like it's about conses and string-bytes. The same behavior happens for ClojureScript projects. Emacs version 30.0.50, linuxmint 21. My gc settings:
(setq gc-cons-threshold (* 80 1024 1024))
(setq gc-cons-percentage 0.33)
(setq read-process-output-max (* 1024 1024))
It's not a new problem for me; it got me to the point of using emacs with jemalloc like:
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so emacs --daemon
This makes the overall experience a little better - the emacs process consumes much less memory (currently reaching 300 MB; previously, it could be even over 500).
Does anybody here know what the issue may be about? Thanks in advance for any help.It could be an instance of https://github.com/clojure-emacs/cider/issues/3206
It happens for non-empty projects, but I haven't checked for (almost) the empty ones. Nevertheless, it looks like it isn't related to any whole-project static analysis. I don't use the language server. But I think (it's only my intuition) that it may have something to do with copying/pasting structures of Clojure code, or with flycheck analysis - I'm using flycheck with clj-kondo.