Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noisy VM Mode #1781

Merged
merged 1 commit into from Jun 13, 2012
Merged

Noisy VM Mode #1781

merged 1 commit into from Jun 13, 2012

Conversation

lenary
Copy link
Contributor

@lenary lenary commented Jun 13, 2012

Sometimes it's useful to be able to diagnose various things via the noise they make, rather than them just printing something.

Someone showed me that haskell has a -B flag that makes your computer beep every time GC runs, and I thought it would be cool/fun/useful to implement for various other languages (including ruby), so I have

It is guarded by also having to enable gc.show so that you get that info as well. I (and others) felt this was the least offensive approach, but they could be made independent in future.

It beeps once for every young generation GC, and twice for every mature generation GC. The beeping is just done by sending ASCII BELL to standard error - so without a terminal/tty it probably won't work.

@travisbot
Copy link

This pull request passes (merged 09d22b8 into dd27810).

@jc00ke
Copy link
Member

jc00ke commented Jun 13, 2012

Heh, fun! We'll have to see what @evanphx & @brixen think about this. 😄

@evanphx
Copy link
Member

evanphx commented Jun 13, 2012

Approve!

@jc00ke
Copy link
Member

jc00ke commented Jun 13, 2012

@lenary can you provide a little script to test this? I'm trying a few things but not hearing a beep. Maybe it's my laptop though.

@tmornini
Copy link
Contributor

My 14 year old son has taught me say SICK when I feel this way!

Fantastic! :-)

dbussink added a commit that referenced this pull request Jun 13, 2012
@dbussink dbussink merged commit df23318 into rubinius:master Jun 13, 2012
@lenary
Copy link
Contributor Author

lenary commented Jun 13, 2012

@jc00ke What I did to see this:

# make etc
$ bin/rbx -Xgc.show -Xgc.noisy
[GC 100.0% 5743/5743 3 7ms]
[GC 100.0% 13674/13674 3 11ms]
[GC 100.0% 13246/13246 3 16ms]
[GC 100.0% 11037/3304 3 16ms]
[GC 84.8% 8995/0 2 8ms]
rubinius  > require "rubygems"
[GC 96.0% 7319/0 2 6ms]
# => true
rubinius  > Gem::Specification.outdated
[GC 100.0% 10256/3868 2 8ms]
[GC 32.3% 15271/0 1 9ms]
[GC 59.1% 4391/0 1 5ms]
[Full GC 20718kB => 20718kB 23ms]
[GC 20.6% 7671/0 1 4ms]
[GC 49.3% 3892/0 1 3ms]
[GC 90.4% 0/0 2 3ms]
[GC 93.2% 0/0 3 3ms]
[GC 48.7% 5799/0 3 4ms]
[GC 3.7% 7293/0 3 5ms]
[GC 42.9% 856/0 3 2ms]
[GC 93.9% 0/0 3 5ms]
[GC 100.0% 10531/10531 3 19ms]
[GC 100.0% 12556/3383 3 18ms]
[GC 100.0% 13873/5862 3 26ms]
[GC 100.0% 14023/6157 3 22ms]
[GC 88.2% 18296/0 2 20ms]
[GC 100.0% 11125/3001 2 30ms]
[GC 100.0% 14171/252 2 13ms]
[GC 58.7% 24899/0 1 14ms]
[Full GC 27834kB => 34041kB 46ms]
[GC 67.8% 13972/0 1 14ms]
[GC 69.7% 16170/0 1 11ms]
[GC 69.9% 16567/0 1 10ms]
[GC 100.0% 7280/7280 2 13ms]
[GC 100.0% 16759/2613 2 20ms]
[GC 100.0% 16426/4425 2 19ms]
[GC 100.0% 16279/2454 2 19ms]
[GC 69.1% 26040/0 1 15ms]
[GC 69.9% 16488/0 1 15ms]
[GC 65.4% 16647/0 1 15ms]
[Full GC 47071kB => 43659kB 56ms]
[GC 0.1% 10982/0 1 4ms]
[GC 0.0% 37/0 1 0ms]
[GC 0.1% 0/0 1 0ms]
# => []
rubinius  > quit

each time there is a [GC ...] message there should be a bell character sounded.

@jc00ke
Copy link
Member

jc00ke commented Jun 14, 2012

@lenary hmm, I don't hear any bells on my machine. Not a big deal though. I'm running Ubuntu 11.10 on a Lenovo. I can't seem to get any ASCII BELL to work though. echo ^G doesn't work either. :( No bells for me.

@mrb
Copy link

mrb commented Jun 14, 2012

This is awesome, 👍

@lenary
Copy link
Contributor Author

lenary commented Jun 14, 2012

@jc00ke some terminals (like iTerm) can be programmed to do something else when a bell happens - i wouldn't be surprised if you had disabled bells entirely, I have disabled sound but it still flashes (usually). I also have a separate profile which does let sound through, for stuff like this - Check your preferences

@jc00ke
Copy link
Member

jc00ke commented Jun 14, 2012

@lenary Thanks for the tip. I checked around and I think it's just completely disabled for we Ubuntu users when Compiz is enabled so no beep for me! Oh well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants