Sublime Forum

Sublime Text build 4196 MAJOR memory leak!

#1

I’ve recently been seeing Sublime-Text randomly crashing, and in some cases, that crash is causing my entire desktop environment of GNOME to go down with it. In investigating I’m seeing the root cause is Sublime-Text being OOM killed for consuming 60GB RAM, and it grows quite fast over a short period of time. Within 5 minutes it’ll be around 30GB.

This is on Ubuntu 24.04, GNOME 46, installed from official sublime-text apt repositories even.

0 Likes

#2

If it doesn’t also happen in SAFE MODE, it’s likely being a plugin causing it.

May also depend on which folders are added to sidebar. Adding home directory or even whole filesystem tree may cause significant RAM usage.

These have at least been the most common causes revealed in earlier reports about this sort of issue.

0 Likes

#3

In addition to the answer of @deathaxe, this is meant by safe mode: https://www.sublimetext.com/docs/safe_mode.html

0 Likes

#4

This is vanilla Sublime Text, no plugins. In linux inside my Documents directory in my home, I subl textfile.txt and the sidebar folder view is open to the entire home directrory

I’ve seen this issue reported similarly here: https://github.com/sublimehq/sublime_text/issues/6254
It’s similar, except… I’m not even opening a folder. Just literally opening Sublime Text on its own, or on a singular file, and it’s continuing to repeat this pattern of behavior in ways I’ve never seen before and it’s making it so I literally cannot use Sublime Text anymore.

0 Likes

#5

If your side-bar contains your entire home folder then you’ve opened your home folder and thus Sublime Text is both scanning and indexing everything in your home folder.

0 Likes

#6

For whatever the reason… Why this would continue to be an issue after closing everything in it, and closing Sublime Text and opening it anew with nothing but itself open, it shouldn’t have re-added the entire home directory back.
But, even still, this still sounds like an issue to me, consuming 64GB and getting OOM-killed just seems quite like something’s not right. This hasn’t always been an issue, as far as I’ve seen the many years as a paying customer of this product and upgrades.

0 Likes

#7

Note that the sidebar is for the files you’re working with in your project and it not meant to be a full on filesystem brower; as noted above, when you open a folder, Sublime spiders the entire content of the folder structure to discover all of the files and folders, so that it can display them in the side bar and show them to you in the file list for Goto Anything (and they are also indexed so you can jump to symbols in them.

Quitting Sublime and restarting it by default brings back the state that it was last in, which includes the files and folders that were open previously.

So, if you accidentally open a folder that you don’t want to be open, you need to take action to either remove the folder from the list of open folders, or open a new Sublime window and then close the first one (which is itself "removing the folder’).

If you don’t, every restart of Sublime will keep restoring the same state.

This includes if you uninstall and reinstall it, because that just removes the application, but your configuration and state is kept safely untouched in your home folder.

0 Likes

#8

I’ll be more mindful of this in the future, considering what I’d seen. I don’t use the sidebar often, or use sublime-text on folders, even. Usually I use it for it’s resilience as an editor and multiple tabs are used as scratchpads, but there’s also times I specifically want to edit that file, too, Those I edit and save and close the tab when done.

0 Likes

#9

If you don’t want Sublime Text to restore its open files and folders you can turn off "hot_exit".

0 Likes