I have been using Ruby debugger and want to be able to get stack dumps from irb. How can I get garbage collection dumps?
Also what patch should I use to be able to tweak the garbage collector a bit?
I have been using Ruby debugger and want to be able to get stack
Share
In Ruby you can re-open classes at any point and redefine them if you want. So you could re-open the GC class and add dumps or redefine any methods you want. You also create aliases of existing methods so that you could call them again later. For example. if you had a class
Foowith a methodbarthat you wanted to add some functionality to, you could do something like:So you take the original
barmethod and alias it tooriginal_bar, then re-openbarand insert your custom code, then reference the originalbarmethod again. BEHOLD THE POWER OF RUBY!