dgutov / robe

Code navigation, documentation lookup and completion for Ruby
584 stars 37 forks source link

Stuck at cpu 100% #121

Closed la-ruby closed 4 years ago

la-ruby commented 5 years ago

Basically when using robe (sometimes) emacs is unresponsive and I see ruby nearly using up all the cpu.

Screen Shot 2019-11-18 at 6 19 23 PM
dgutov commented 5 years ago

Can you see which request spins up all this CPU usage?

Robe creates access log files in /tmp/robe-access-xxxx.log, you can look for the most recent one.

la-ruby commented 5 years ago

It took a few days, but finally it happened again:

I, [2019-11-21T19:00:44.143674 #10825]  INFO -- : GET /ping/
I, [2019-11-21T19:00:44.150789 #10825]  INFO -- : GET /load_path/
I, [2019-11-21T19:00:44.155896 #10825]  INFO -- : GET /method_targets/new/DummyClass/HubshoplyBigcommerceTest/-/-/-
Screen Shot 2019-11-21 at 7 01 15 PM

Cursor is at position shown in screenshot, and last thing I did was press "C-c C-d"

oh btw i not sure if its because I'm on macos beta 2, but the log file isn't where you think it is ( /System/Volumes/Data/private/var/folders/w2/htjjxxl52ssdll1yhyz1t7380000gn/T )

dgutov commented 5 years ago

Thanks!

Cursor is at position shown in screenshot, and last thing I did was press "C-c C-d"

So what happens if you restart Emacs, etc, and the do the same thing at the same position? Does it freeze immediately as well? In other words, is the problem easy to reproduce?

oh btw i not sure if its because I'm on macos beta 2, but the log file isn't where you think it is ( /System/Volumes/Data/private/var/folders/w2/htjjxxl52ssdll1yhyz1t7380000gn/T )

That's fine, I really have no idea which directories macOS uses for tmp storage.

dgutov commented 4 years ago

Another thing to try is to install https://github.com/rbspy/rbspy.

When (if!) this happens again, you can ps aux | grep ruby, find the process pid, and then output its current backtrace: sudo rbspy snapshot --pid <pid>.

dgutov commented 4 years ago

Anyway, I have fixed a similar behavior recently (https://github.com/dgutov/robe/issues/105).

Here's hoping it took care of this case as well.

If it happens again, let me know.

la-ruby commented 4 years ago

I was reading the emacs Changelog last week and was pleasantly surprised to see your name - its great a ruby developer playing an active role in the emacs core, keep up the good work! @dgutov