Sublime Forum

Sublime Text 3 occasionally has very high CPU load

#1

I am running Sublime Text 3 (build 3012) on Ubuntu 12.04 with the KDE Desktop 4.8.5.

I thought I’d submit this problem in case the information is useful to you.

For example, when running 4 or 5 instances of Sublime, I noticed that my CPU load was nearly 100%

Listing the processes I saw this:

$ ps -Af | grep [s]ublime robh 4532 4763 38 15:04 ? 00:13:26 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:251 robh 4533 4763 2 15:04 ? 00:00:44 [sublime_text] <defunct> robh 4534 4763 38 15:04 ? 00:13:28 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:251 robh 4535 4763 37 15:04 ? 00:13:18 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:251 robh 4547 4763 37 15:04 ? 00:13:05 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:252 robh 4548 4763 37 15:04 ? 00:12:53 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:252 robh 4549 4763 37 15:04 ? 00:13:02 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:252 robh 4550 4763 7 15:04 ? 00:02:41 [sublime_text] <defunct> robh 4567 4763 33 15:06 ? 00:11:07 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:253 robh 4568 4763 33 15:06 ? 00:11:08 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:253 robh 4569 4763 33 15:06 ? 00:11:02 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:253 robh 4570 4763 3 15:06 ? 00:01:04 [sublime_text] <defunct> robh 4583 4763 32 15:07 ? 00:10:21 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:254 robh 4584 4763 32 15:07 ? 00:10:10 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:254 robh 4585 4763 32 15:07 ? 00:10:14 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:254 robh 4596 4763 32 15:08 ? 00:10:01 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:255 robh 4597 4763 32 15:08 ? 00:10:03 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:255 robh 4598 4763 32 15:08 ? 00:09:58 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:255 robh 4599 4763 3 15:08 ? 00:01:00 [sublime_text] <defunct> robh 4763 1 1 09:03 ? 00:05:09 /usr/lib/sublime_text_3/sublime_text robh 4778 4763 0 09:03 ? 00:00:04 /usr/lib/sublime_text_3/plugin_host 4763 robh 5167 4763 32 15:08 ? 00:09:52 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:257 robh 5168 4763 32 15:08 ? 00:09:59 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:257 robh 5169 4763 3 15:08 ? 00:00:57 [sublime_text] <defunct> robh 5170 4763 31 15:08 ? 00:09:47 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:257 robh 5630 4763 31 15:09 ? 00:09:39 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:258 robh 5631 4763 32 15:09 ? 00:09:42 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:258 robh 5632 4763 31 15:09 ? 00:09:35 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:258 robh 5633 4763 32 15:09 ? 00:09:47 /usr/lib/sublime_text_3/sublime_text --crawl 4763:crawl:258 robh 6102 2264 1 15:39 ? 00:00:00 /usr/bin/nepomukindexer /home/robh/sublime_projects/core-project.sublime-workspace

I have seen this occur a small number of times. Unfortuntely, I do not know exactly what I do that triggers this specific behaviour; it might be random.

I do not remember seeing this problem with version 2 of Sublime.

I suppose it could be a bug in nepomukindexer (whatever that is; probably a Ubuntu or KDE built-in?). Here are some other enties relating to that, in case that’s relevant:

robh 2172 1 0 08:43 ? 00:00:00 kdeinit4: kdeinit4 Running... robh 2223 2172 0 08:43 ? 00:00:00 /usr/bin/nepomukserver robh 2264 2223 0 08:43 ? 00:01:26 /usr/bin/nepomukservicestub nepomukfileindexer

However, I wondered whether this problem is associated with the new symbol finding feature, due to the presence of --crawl in the process commands. (The files being edited were C++, JSON, make and text.)

I also wonder whether this nepomuk service is associated with the indexing.

0 Likes

#2

Update:

I have now seen the same behaviour running a single instance of Sublime Text 3 running, with a project file.

Now the CPU load is very high again, and now nepomukindexer is not involved.

$ ps -Af | grep [s]ublime robh 6636 1 2 16:31 ? 00:00:05 /usr/lib/sublime_text_3/sublime_text robh 6648 6636 0 16:31 ? 00:00:00 /usr/lib/sublime_text_3/plugin_host 6636 robh 6652 6636 98 16:31 ? 00:03:44 /usr/lib/sublime_text_3/sublime_text --crawl 6636:crawl:1 robh 6653 6636 98 16:31 ? 00:03:44 /usr/lib/sublime_text_3/sublime_text --crawl 6636:crawl:1 robh 6654 6636 98 16:31 ? 00:03:44 /usr/lib/sublime_text_3/sublime_text --crawl 6636:crawl:1 robh 6655 6636 98 16:31 ? 00:03:44 /usr/lib/sublime_text_3/sublime_text --crawl 6636:crawl:1

This time I also note that there are no <defunct> processes.

This is reproducible with a particular project. I don’t seem to have problems with other projects. As yet I can’t see any significant difference in the project (or workspace) files as compared to my many other projects.

I will update again if I manage to narrow this problem down further… (Unfortunately, I can’t supply you with a set of files.)

0 Likes

#3

Update:

Some experimentation seems to have shown that the problem is not with the project or workspace files.

I have a data subdirectory containing 32 JSON files ranging in size from 85.9kB up to 4.8MB. Each of these has only a single (very long) line. The problem seems to be worse the more of these I restore. Starting the project with just the 16 smallest files (up to 967kB) showed a high CPU load for a few minutes, and the load then dropped. Whilst the load was high, the processes included the “crawlers”. Once the load started to drop (in steps) the crawler processes were seen to gradually disappear. The load eventaully drops back down to idle level, and the only remaing processes are ‘sublime_text’ and ‘plugin_host’.

Thus, I imagine that the CPU load is remaining high whilst my JSON data files are being traversed. The total data size is 68.8MB, which isn’t that much. Probably, if I waited long enough, I would see the load eventually drop even with the directory in its original state.

There may be scope for modification or optimisation here. Should JSON files be traversed (for symbols)?

For the time being, I will work around the problem. I might keep these files outside my source directory. Alternatively there might be a way to exclude the data folder from the search, such as with folder_exclude_patterns(I have not tried that approach yet).

Thanks,
Rob.

0 Likes