Just a small benchmark to clear up the myth, Ruby wouldn'd garbage collect any Symbols. In fact, MRI 2.2.0 introduced Symbol GC in December 2014 (see notable changes in the release announcement).
The benchmark is quite simple: It basically cretes a bunch of Symbols via String#to_sym
and counts Symbol::all_symbols
afterwards.
I've used rbenv to test the Symbol GC (or the lack thereof) of these interpreter implementations:
- 1.9.3-p551
- 2.0.0-p645
- 2.1.6
- 2.2.2