ConradIrwin / pry-rescue

Start a pry session whenever something goes wrong.
MIT License
852 stars 49 forks source link

Memory leak #32

Closed jmuheim closed 11 years ago

jmuheim commented 11 years ago

Hey Conrad

We had to remove pry-rescue from our Rails project as it seemed to lead to a memory leak: as soon as a binding.pry statement was in the code, the rails server Ruby process grew bigger and bigger and reached many GBs within half an hour or so.

Do you know something about this? Thanks

ConradIrwin commented 11 years ago

Yes, I know about this. I haven't worked out the best way to fix it but I think it is not too hard. Instead of storing exception metadata in a global array we should attach it to the exception object itself.

jmuheim commented 11 years ago

Does not requiring pry-rescue in the Gemfile solve the problem?

We had this: gem 'pry-rescue', now we use gem 'pry-rescue', require: false.

jmuheim commented 11 years ago

Because of the memory leak, my co-workers don't want pry-rescue in the Gemfile. Is there any other way to load it as needed?

rking commented 11 years ago

On Tue, Mar 19, 2013 at 05:24:32AM -0700, Joshua Muheim wrote:

Because of the memory leak, my co-workers don't want pry-rescue in the Gemfile. Is there any other way to load it as needed?

pry-debundle, or some variation of its source should work for you.

—☈

ConradIrwin commented 11 years ago

Unfortunately pry will auto-require all plugins, so even setting it to not require in bundler will not help.

I'll work on fixing this, as it's lame that you can't use pry-rescue because of it :(.

jmuheim commented 11 years ago

You should at least give a hint in the README, my co-worker spent an hour or two locating the memory leak problem. ;)

jmuheim commented 11 years ago

Thanks, I will try it in the upcoming days.

ConradIrwin commented 11 years ago

Was just about to ask you to, awesome! :)