开发者

Is this normal? CPU usage 50% for ruby?

开发者_C百科

Running on Macbook Pro unibody OSX 10.6 Snow Leopard, dual-core. I notice Activity Monitor is stating the ruby process running at 50% consistently...

Is anyone seeing the same results? Is this 'normal'?

EDIT: Further into clarifying. My hands are not on the keyboard. The Rails server and ruby console are running, but without any activity. I am also running Rails 3.1 RC1.


It depends on what you are doing. If you do simply nothing, then no, this isn't normal. If you are actively developing, then you might have created an endless loop.


Usually, one infinity loop uses one core of CPU (50% usage in your case, because your Mac has got dual-core).


It's not common, no. I've seen it happen a few times, but I don't know why.. It's not a endless loop in my code. I suspect a race condition somewhere deep in the stack or in the interpreter. It happens most often after a resume from sleep event I think.

I just kill the process.


I've restarted the server. The CPU process for Ruby seems to have subsided to a more reasonable state / percentage. At the moment, at a 0.2.

I'm starting to suspect that something may have triggered a CPU spike with Rails 3.1 RC1. After all, it is still not the stable release of Rails. Will observe how this plays out.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜