Search code examples
rubyequivalent

Ruby equivalent of PHP's "get_defined_vars" function?


I've written a little while loop program in ruby and I can see the RAM it use is visibly growing after each loop !

So I trayed to :

  • Use GC.Start at the end of the loop but it has no effects
  • Change all inside loop variable to Global but memory used still raise after each loop.

So is there any equivalent of PHP's "get_defined_vars" function in Ruby in order to view wich make my used memory growing like that ?


Solution

  • Kernel.local_variables seems to be the closest match