Issue #10686 has been updated by Eric Wong.


 This seems to fix it:
 
 --- a/symbol.c
 +++ b/symbol.c
 @@ -664,6 +664,7 @@ rb_gc_free_dsymbol(VALUE sym)
      if (str) {
  	RSYMBOL(sym)->fstr = 0;
  	unregister_sym(str, sym);
 +	rb_hash_delete(global_symbols.dsymbol_fstr_hash, str);
      }
  }
  
 
 http://80x24.org/spew/m/85a6346bf10d3f37fecb4926a57699fbd82b45b6.txt

----------------------------------------
Bug #10686: Memory leaking from torture test of symbol GC
https://bugs.ruby-lang.org/issues/10686#change-50736

* Author: Charles Nutter
* Status: Open
* Priority: Normal
* Assignee: 
* Category: core
* Target version: current: 2.2.0
* ruby -v: 2.2p0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
The following code appears to grow without bounds when running on MRI 2.2p0 (and grows *very* fast...hold on to your RAM):

```
x = 0; loop { (x += 1).to_s.to_sym }
```

I asked ko1 about this on Twitter and he said it appears to be leaking strings somewhere.



-- 
https://bugs.ruby-lang.org/