# Ruby 1.8.6. - 100% CPU on OS X

**URL:** <https://www.ruby-forum.com/t/ruby-1-8-6-100-cpu-on-os-x/147660>\
**Category:** Ruby\
**Created:** [September 4, 2008, 1:56am UTC](https://www.ruby-forum.com/t/ruby-1-8-6-100-cpu-on-os-x/147660 "2008-09-04T01:56:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![revlob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@revlob](https://www.ruby-forum.com/u/revlob)\
**Post date:** [September 4, 2008, 1:56am UTC](https://www.ruby-forum.com/t/ruby-1-8-6-100-cpu-on-os-x/147660/1 "2008-09-04T01:56:22Z")

</div>

Recently Ruby has decided to stomp my CPU. After running for a bit Ruby  
sometimes spikes to 100% CPU - even if I just have, say, the IRB open in  
terminal.

Any ideas?

David

---

<div class="post-metadata">

**Author:** ![revlob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@revlob](https://www.ruby-forum.com/u/revlob)\
**Post date:** [September 4, 2008, 7:19pm UTC](https://www.ruby-forum.com/t/ruby-1-8-6-100-cpu-on-os-x/147660/2 "2008-09-04T19:19:32Z")

</div>

On Wed, Sep 3, 2008 at 5:50 PM, David E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

Are there other things running that you think should be sharing with the  
cpu? You could always renice the process so it doesn’t hog if it is  
causing  
you problems.

–  
“Hey brother Christian with your high and mighty errand, Your actions  
speak  
so loud, I can’t hear a word you’re saying.”

-Greg Graffin (Bad Religion)

---

<div class="post-metadata">

**Author:** ![revlob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@revlob](https://www.ruby-forum.com/u/revlob)\
**Post date:** [September 4, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/ruby-1-8-6-100-cpu-on-os-x/147660/3 "2008-09-04T19:47:21Z")

</div>

Glen H. wrote:

> On Wed, Sep 3, 2008 at 5:50 PM, David E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > 
> 
> Are there other things running that you think should be sharing with the  
> cpu? You could always renice the process so it doesn’t hog if it is  
> causing  
> you problems.
> 
> –  
> “Hey brother Christian with your high and mighty errand, Your actions  
> speak  
> so loud, I can’t hear a word you’re saying.”
> 
> -Greg Graffin (Bad Religion)

Usually I just kill the process. Not a big problem when it happens once  
in a while. But now it’s happening several times a day…

Can’t find a reference anywhere about ppl having similar problems…

---

<div class="post-metadata">

**Author:** ![revlob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@revlob](https://www.ruby-forum.com/u/revlob)\
**Post date:** [September 4, 2008, 8:05pm UTC](https://www.ruby-forum.com/t/ruby-1-8-6-100-cpu-on-os-x/147660/4 "2008-09-04T20:05:37Z")

</div>

> Can’t find a reference anywhere about ppl having similar problems…

I’ve had similar problems before–I think it might be some type of an OS  
X thing, and is especially aggravated when using multiple ruby threads  
[if I remember correctly]. You can use dtrace [google for it, or a  
small hack is [1]] and see if it looks familiar to you at all.  
I posted something about something once:  
[http://www.ruby-forum.com/topic/153559#new](http://www.ruby-forum.com/topic/153559#new)

TAke care.  
-=R

[1] [http://betterlogic.com/roger/?p=271](http://betterlogic.com/roger/?p=271)

---

<div class="post-metadata">

**Author:** ![revlob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@revlob](https://www.ruby-forum.com/u/revlob)\
**Post date:** [September 4, 2008, 8:09pm UTC](https://www.ruby-forum.com/t/ruby-1-8-6-100-cpu-on-os-x/147660/5 "2008-09-04T20:09:55Z")

</div>

On Thu, Sep 4, 2008 at 11:41 AM, David E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > "Hey brother Christian with your high and mighty errand, Your actions  
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Well if the process is actually running (garbage collection maybe) then  
it  
would use clock cycles and if there is nothing else needing those cycles  
I  
would expect it to use 100%.

–  
“Hey brother Christian with your high and mighty errand, Your actions  
speak  
so loud, I can’t hear a word you’re saying.”

-Greg Graffin (Bad Religion)

---

<div class="post-metadata">

**Author:** ![revlob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@revlob](https://www.ruby-forum.com/u/revlob)\
**Post date:** [September 5, 2008, 12:11am UTC](https://www.ruby-forum.com/t/ruby-1-8-6-100-cpu-on-os-x/147660/6 "2008-09-05T00:11:17Z")

</div>

-------- Original-Nachricht --------

> Datum: Fri, 5 Sep 2008 06:44:13 +0900  
> Von: “Michal S.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> An: removed\_email\_address@domain.invalid  
> Betreff: Re: Ruby 1.8.6. - 100% CPU on OS X

> with the
> 
> > > >
> 
> cause noticeable load. After all, top uses about one third of all cpu  
> time on these …
> 
> If it’s on decent hardware then irb consuming noticeable amounts of  
> CPU time sounds fishy. But then Firefox always eats some cpu time for  
> me, and there is usually plenty left so I don’t watch it too closely.
> 
> Thanks
> 
> Michal

Hi –

I don’t know if this applies to your CPU load problem, but I’ve had  
several strange errors related to Ruby  
(on Linux Ubuntu).  
When I reported them on this and other lists, the authors of various  
gems told me that they had tried  
their software on a fresh install of Ubuntu and Ruby and their gem,  
without problems.  
I then reinstalled Ubuntu on my system, and Ruby, from source, and  
everything else, and the bug disappeared.

I wrote something like that in response to another post, and Ara Howard  
wrote that he had had issues with  
Ruby and OS X as well.

[http://www.ruby-forum.com/topic/164627#new](http://www.ruby-forum.com/topic/164627#new)

Maybe a reinstall from source can help ?

Best regards,

Axel

---

<div class="post-metadata">

**Author:** ![revlob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@revlob](https://www.ruby-forum.com/u/revlob)\
**Post date:** [September 5, 2008, 12:24am UTC](https://www.ruby-forum.com/t/ruby-1-8-6-100-cpu-on-os-x/147660/7 "2008-09-05T00:24:46Z")

</div>

On Thu, Sep 4, 2008 at 4:04 PM, Axel E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > > > you problems.  
> > > > > once  
> > > > > would use clock cycles and if there is nothing else needing those  
> > > > > CPU time sounds fishy. But then Firefox always eats some cpu time for  
> > > > > (on Linux Ubuntu).
> 
> Psssst! Schon das coole Video vom GMX MultiMessenger gesehen?  
> Der Eine fÃ¼r Alle: [GMX Produkte Übersicht: Apps, Browser, MailCheck und Co.](http://www.gmx.net/de/go/messenger03)

I wonder if it does the same on the \*BSDs?

–  
“Hey brother Christian with your high and mighty errand, Your actions  
speak  
so loud, I can’t hear a word you’re saying.”

-Greg Graffin (Bad Religion)

---

<div class="post-metadata">

**Author:** ![revlob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@revlob](https://www.ruby-forum.com/u/revlob)\
**Post date:** [September 4, 2008, 11:50pm UTC](https://www.ruby-forum.com/t/ruby-1-8-6-100-cpu-on-os-x/147660/8 "2008-09-04T23:50:46Z")

</div>

On 04/09/2008, Glen H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > 
> > 
> > ## Can’t find a reference anywhere about ppl having similar problems…
> > 
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> Well if the process is actually running (garbage collection maybe) then it  
> would use clock cycles and if there is nothing else needing those cycles I  
> would expect it to use 100%.

Well, if it’s on something like a G3 there aren’t many CPU cycles,  
spare or otherwise. Something like garbage collection could possibly  
cause noticeable load. After all, top uses about one third of all cpu  
time on these …

If it’s on decent hardware then irb consuming noticeable amounts of  
CPU time sounds fishy. But then Firefox always eats some cpu time for  
me, and there is usually plenty left so I don’t watch it too closely.

Thanks

Michal
