This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Succeeding with AI and have Veljko Krunic on-line!
See this thread for details.
Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

GC in ruby

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic