Sublime Forum

Sublime crashing with large Find In Files results

#1

I frequently crash Sublime with Find In Files when there is a large result set. In particular, if there is an extremely long line (1 MB in one line, perhaps?) that matches, Sublime will often lock up. It may also happen with a simply large result set, without any extremely long lines. It’s hard to investigate that, as I can’t scroll the results tab once it locks up.

When it does, I get the spinning mouse cursor and I have to Force Kill Sublime. When I reopen the app, sometimes it is challenging to close the Find Results tab quickly enough upon restart before it locks up again.

When this occurs, a repeat search consistently will lock it up again.

This is in a project of 10,000 files.

I’ve been seeing this behavior for months. I’ve searched this forum and the Internet and have not found any similar reports.

I am running v3.1.1, Build 3176 (the most current version) on Mac High Sierra v10.13.6.

0 Likes

#2

related:



0 Likes

#3

This cropped back up today. I don’t think I’ve seen it in a few months. Now, I’m unable to reclaim Sublime. I can force-quit it (Mac), and restart, but I can’t kill the offending long-line file before it locks up again. I think it may be a conflict between the long-line file locking up, and a separate file offering a “…has changed on disk. Do you want to reload it?” dialog. I cannot dismiss the dialog, or or close any tabs. Not sure how to get past that…

Any help will be welcomed!

0 Likes

#4

If the problem is that when you start Sublime, there’s a file with a long line currently open (or find results that are displaying one) that’s stopping it from recovering the session without getting into the same situation, you can resolve that by removing or renaming the session file.

That would make Sublime start up with an empty window; i.e. the record of your open files, their layouts, any unsaved changes, etc would all be lost, but it would start. If there were files with unsaved changes that you need to recover, you can selectively pull them from the session file.

It’s also possible (via another editor) to attempt to remove the entry for the offending file from the session entirely, though that is a bit more advanced a topic.

The session file is stored in your Data directory, which is a folder stored somewhere in your user folder; the location can be found at https://www.sublimetext.com/docs/3/revert.html. Inside of that path, the session is stored as Local/Session.sublime-session.

3 Likes

#5

Thanks for you help, @OdatNurd. Being able to delete the session file per your instructions saved my bacon again today, when I could not get out of a crash loop.

I’m still struggling with the core problem, and I hope the dev team at Sublime has a fix on their roadmap.

I’ve added three folders to the binary_file_patterns setting:
“binary_file_patterns”: [ <…snip…>, “node_modules/”, “coverage/”, “tmp/cache/”]

This helps me avoid getting those long files into my search results, (and speeds my project-wide searches of 10K files from 7 seconds to 0.5 seconds), but every once in a while some long, single-line file still sneaks in and jams up Sublime’s gears.

0 Likes