Sublime Forum

Infinite loop causes the whole system to crash, python

#1

I found this problem on ST2 and beta ST3. When you create an infinite loop in python, the editor freezes and there is no good way to bring it back to life other than restart. I saw the similar reports on this forum, but decided to create a new topic, since those reports seems unresponded.

0 Likes

Infinite Loop Issue
#2

I am surprised this is from Oct 2013, I have commented the below in 2 other forums, will wait for someone to help:

did an infinite loop but in my case Sublime Text is not responding anymore and Memory starts to increase like crazy, I tried deleting file which I worked with, I deleted the AppData/Local/Sublime Text 3 folder and uninstalling & reinstalling but no success.

0 Likes

#3

The Sublime Text 3 folder that’s in AppData/Local only stores the Cache and Index folders, which are used to store the results of compiled syntax definitions and indexed symbols in your code, respectively. As such, if you remove those the only side effects are that at the next startup all of the syntaxes will be recompiled and all of your files will need to be reindexed.

If you want to reset Sublime to a clean state, you want to delete (or rename) the Sublime Text 3 folder in AppData/Roaming instead; that one stores things like the session information, your User package, and so on.

With this said, from your description of the issue there are two possible culprits that spring to mind.

The first would that that since you mentioned a Python program had the infinite loop that perhaps you saved a copy of the file somewhere in the Packages folder (say in your User folder). If so, Sublime is treating it like a plugin and executing it at startup, so removing it will fix the problem.

However you mentioned in one of the other posts that you already removed the file. As such the next logical candidate is something along the lines of Sublime having problems restoring from the saved session information. This might happen if you used a REPL plugin to execute your script, for example. In that case the Session might be trying to restore the saved contents of the REPL tab.

If that’s the case then deleting the Local/Session.sublime-session file and restarting Sublime may resolve the problem for you. That would keep all of your packages intact but drop away the list of files that you had open at the time.

There may be other reasons for this to happen, but for that we’d need more information about how exactly you were trying to run the program in the first place.

2 Likes

Infinite loop inside Python script