Disabling the Garbage Collector : GC « Development « Ruby






Disabling the Garbage Collector


h = {}
GC.disable if ARGV[0]
5e5.to_i.times {|i| h[i] = "dummy"}
h = nil
GC.enable
GC.start

 








Related examples in the same category

1.Call GC to do a garbage collection