Richard Bucker

Fork bomb - Ruby

Posted at — May 23, 2012

I’m reading a new book titled Working with Unix Processes which is published by, you guessed it, pragprog.com. I cannot tell if this book is golden or beta but that nugget aside it’s actually an easy book to read. The author is trying to show how connected Ruby is to Unix processes and for the most part he meets the mark.What troubled me is not the tight coupling of Ruby to Unix but it was the notion of a fork bomb and that Ruby uses about 500MB (half a gig) of main memory before the application actually does anything. This suggests that with just a fews forks and average memory amounts one could bomb the target system.Which has me asking the same question of Python, C, java and go.PS: forking is probably not the right thing to do. daemontools and tools like it are a better approach for demonizing your apps.