This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Ruby and the fly likes GC in ruby Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Languages » Ruby
Bookmark "GC in ruby" Watch "GC in ruby" New topic
Author

GC in ruby

aparna dingankar
Greenhorn

Joined: Jul 21, 2009
Posts: 9
Congrats for promotion of The Well-Grounded Rubyist book. Have one question I have doubt regarding garbage collection feature in Ruby . Is it same as Java. And how open is Ruby to other platforms ? I hope I get answers for my doubts..


If we can keep our preconceived notions behind,
every unsolvable problem can have a solution!
---George Bernard Dantzig
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Regarding garbage collection, Ruby's is way, way behind the JVM (Java) and the CLR (.NET). The biggest difference is that Ruby's garbage collection is non-generational, meaning that when Ruby's GC does its sweep, it iterates through all objects checking they're eligibility for garbage collection. Googling for "ruby garbage collection" gives you some pretty good (and more elaborate) descriptions of how Ruby's garbage collection is implemented.

Regarding openness to other platforms, Ruby itself has the ability to integrate native libraries which you can then use to bridge to other platforms such as Java (through JNI). However, perhaps the more relevant interoperability strategy is to run your Ruby code on JRuby, which is a Ruby implementation running on the JVM.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GC in ruby