Is it possible to use GDB (or similar) to get a stackdump of what ST is doing during theses pauses?
Do you think that would help?
ST4 Mac slowness
To give closure on my case, removing Anaconda ended the slowness problems, I installed instead the Language Server stuff for. Python. I eventually got it working, but it was painful without a full set of instructions. E.g., where is the definitive definition of which executable to use. Oh, I have to install that too? And the other thing? And so forth. MagicPython didn’t work because of a regex error. Then syntax highlighting failed, and I had to figure out how to get it working again. If I had only known, I might not have upgraded.
We ship debug symbols so using lldb would certainly help, but on macOS you can only attach a debugger to self-signed executables so it’s not as simple as running the debugger.
If the pause is slow enough an easy way to get diagnostic information is to use Activity Monitor, click on ST and under the … button select “Sample Process”.
I was able to do this but it seems quite chatty. Can I assume it would be much easier to analyze the sample output if I were running ST in ‘safe’ mode?
I don’t see that reducing it at all. It’s a dump of all threads from the application, which is always going to be quite a bit of data.
FWIW since there are symbols in the build, you should be able to get profiling information via XCode Instruments in Time Profiler mode even for a signed app (I just did a quick test and was able to attach it to ST4). This might be more informative than just a stackdump, depending on what’s happening.
If you are using a m1 or latest MacOS version, make sure you turn off low powered mode. It will slow down things, especially on startup if you are using it against a medium size or more project.
See Low Power Mode Section From Apple Support
Thanks for sending the sample. It looks like it’s spending its time collecting files for indexing. How many files do you have open in the side-bar? Does it improve if you use "index_skip_unknown_extensions": false?
Build 4125 has been a MAJOR improvement for me. I just want to say thanks because for many months typing felt sluggish, specially when autocompletion pop-ups showed up. Not anymore.
Just that, most of us only appear around these corners to complain, but hey, what’s fair is fair: WELL DONE.
Also,
"index_skip_unknown_extensions": false
did seem to help a bunch for Build 4121.
Sorry if it wasn’t clear, I mean how many files are in the folders you have open in the side-bar?
I just want to chime in and report the same issue. I had to move from Linux to Mac (intel based) due to work and Sublime Text starts out fine, then gradually consumes more and more RAM. It will use 2.5GB in about an hour and after a full day reach 19GB. (including swap)
I use LSP and Elixir LSP. Please don’t ask me to test in safe mode, because then I don’t really see any reason to use Sublime Text at all anymore.
If you’re using Monterey there’s known memory leaks outside of our control, see https://github.com/sublimehq/sublime_text/issues/4960 and https://bugzilla.mozilla.org/show_bug.cgi?id=1735345
Sublime Text 4 Build 4126 On M1 Max Pro
In that case I’d check which exact process is using the memory, if it’s not the main sublime_text process then the leak is certainly caused by a plugin.
How pervasive is this issue? I’d been holding out on updating to ST4 and wondering if I should continue waiting as I’m on an M1 MBP with Monterey 12.1.