Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP 100% CPU usage with Sublime Text 3

I use Sublime Text 3 for web development. From time to time, it starts PHP process with CPU usage of 100%. My Mac starts to be laggy then and fans are loud.

How can I investigate why is it happening? I think it's one of the plugins that I'm using: SublimeLinter-php or SublimeLinter-phpcs, but I'm not sure.

Is there any way to check it out other than just disabling plugins and waiting if that happens? That would be troublesome, because sometimes it happens after a few hours and development without them is troublesome for me. Have you experience this kind of behavior with Sublime Text 3?

like image 995
Robo Robok Avatar asked Feb 21 '15 10:02

Robo Robok


4 Answers

It might be caused by Sublime's file indexing. (https://github.com/SublimeTextIssues/Core/issues/537)

Try adding "index_files": false to your user preferences (Preferences > Settings - User) and see if that helps.

If it does, you might be able to troubleshoot it using this page: http://www.sublimetext.com/blog/articles/file-indexing

like image 169
Tom de Boer Avatar answered Nov 07 '22 16:11

Tom de Boer


I had this issue too with web/nodejs projects. Instead of completely disabling the indexing, i just ignored my node_modules folder which contains node dependencies.

I you are working with php, you may ignore some folders such as vendor.

In your settings add the following line :

Example :

"index_exclude_patterns": ["*.log", "node_modules/*", "vendor/*"]
like image 6
Hugo Mallet Avatar answered Nov 07 '22 16:11

Hugo Mallet


I discovered that Sublime Text 3 on Yosemite (Macbook Air 2014) had begun to lag, looking at the Activity Monitor Sublime was at 150% CPU. After finding this thread that we're currently reading, about how a plugin for SublimeLinter was the source of some problems, I disabled SublimeLinter-jshint and Sublime immediately dropped. Unfortunate, because it is an awesome tool for Sublime.

It is now idling between 2% and 10% after disabling jsHint.

like image 3
kevbost Avatar answered Nov 07 '22 14:11

kevbost


PhpConnector gives me also high cpu usage. I removed it ant all went back to normal. So, in my case both PhpConnector and SublimeLinter-phpcs provoke high cpu usage.

like image 1
Kris Rott Avatar answered Nov 07 '22 16:11

Kris Rott