Sublime Forum

Memory Usage

#21

{
“theme”: “Default Dark.sublime-theme”,
“color_scheme”: “Packages/Color Scheme - Default/Mariana.sublime-color-scheme”,
}

0 Likes

#22

if the indexing is the problem, how I can solve this? (I need an indexer for huge project)

0 Likes

#23

after some experiments, looks like it is and indexer issue, when I disable the indexer the issue is solved, but in other hand I need the indexer, any idea how to make the indexer work smoothly ?

0 Likes

#24

Is it still running when you see the high memory usage? What’s the information from Help > Indexing Status…?

0 Likes

#25

looks like it is stuck:


and using more than 10GB ram

0 Likes

#26

Any errors in the console?

0 Likes

#27

no, no errors

0 Likes

#28

That’s very odd. It should at least log that it started a worker for indexing, otherwise I don’t see how it could even start indexing. Are you sure that’s the only window you have open?

0 Likes

#29

I have tried again, this is what I get: with 10GB memory usage.

0 Likes

#30

That’s certainly not hundreds of files, you have hundreds of thousands of files there. That shouldn’t be an issue, but it looks like the index collation is taking ages so something is definitely wrong. (For reference opening the Linux kernel has 60k files and takes 5s to collate here). Clearing the cache may have an effect: ~/Library/Caches/Sublime Text.

0 Likes

#31
  1. the indexer can not manage with this large amount of files ?
  2. I have tried to remove the Caches and even to reinstall sublime but facing same issue :frowning:
0 Likes

#32

the indexer can not manage with this large amount of files ?

It certainly can (as I stated earlier, it does fine on my end with a similarly sized repository). But you stated earlier that you had hundreds of files, which would hint to a problem outside the indexer; with hundreds of thousands of files it’s much more likely to be an indexer related problem. Without accurate information it’s hard to provide help and debug issues.

What kind of files are they? Does it happen for any other project for you or just this specific one?

0 Likes

#33

It includes C/Python/C++ and much more types of files.
I have reduced the number of indexed files to 45K, and now I see that the memory usage is ~1.3GB.
I have to say that the memory usage gets more significant after the indexer finishes and not during the indexing process.
Any idea what I can improve more?

0 Likes

#34

I have noticed another issue. Another copy of the same repository does not face this problem. Just one copy, can it be related to git branches?

0 Likes

#35

Any git state is derived well before the indexer completes, so that’s unlikely to be the issue. Perhaps it’s indexing build data or something else along those lines? It may be useful to do a directory diff between the two copies.

0 Likes

#36

I’m having the same issue. I’ve been a happy Sublime user on Linux, but I started a new job and have a fairly large Elixir repo on MacOS Big Sur.

I have LSP and Elixir LS packages installed. When I start Sublime, the RAM will climb to about 4GB in an hour and when after a days work it has taken up 19GB. I don’t know if it will continue, because by that time it becomes so unresponsive, I have to restart Sublime.

When I disable LSP and Elixir LS this issue does not occur. To be fair, I just leave Sublime running in the background and don’t use it much then. But I find these tools essential. I am now using VS Code, but I really would rather stick with Sublime.

0 Likes

#37

Which process is using the RAM? ST has separate processes for plugins and LSP additionally spawns extra processes.

0 Likes

#38

Just signed up to the forums to report that i’m also experiencing this.

Using build 4121 on a M1 Mac with Monterey.

With index_files set to true, memory starts at 5 GB right off the bat and slowly but steadily climbs until macOS complains and i have to force quit Sublime.

I have a large code repo open (this is nothing new), but I never experienced this problem until recently.

With index_files disabled, Sublime seems to be only using around 1 GB. I’ll use it like this for a few days and post here if I see anything odd.

0 Likes

#39

Note that Monterey has known memory leaks, see https://bugzilla.mozilla.org/show_bug.cgi?id=1735345

0 Likes

#40

Interesting.

Still weird that only Sublime seems to be affected (assuming Activity Monitor is telling the truth).

0 Likes