Tracking down a memory leak in Ruby's EventMachine
blog.nelhage.com
Tracking down a memory leak in Ruby's EventMachine
1–10 of 33 posts
Re: Tracking down a memory leak in Ruby's EventMachine
#2Re: Tracking down a memory leak in Ruby's EventMachine
#31. It shows how bugs can be something quite conceptually simple
2. It shows the value of logical, detective-like thinking in tracking these bugs.
Even as a programmer, I still think of bug-hunting as something requiring an encyclopedia knowledge of the trivial and arcane. Obviously, it looks easier in hindsight, but the OP does a great job of demonstrating how you can discover a much-overlooked flaw with the right deductive thinking (and experience with profiling tools)
Re: Tracking down a memory leak in Ruby's EventMachine
#4Other platforms likely have similar tools, though I have yet to stumble across one as easy to use.
Re: Tracking down a memory leak in Ruby's EventMachine
#5Like danso, I admire the detective-work here. I would like to point out, though, that XCode's Instruments utility has a fantastically useful "Leaks" mode that will identify leaked allocations, including a stack trace. It can attach to a running process and has a non-disastrous impact on performance, though like most such tools it's voracious for memory. Other platforms likely have similar tools, though I have yet to…
Also, we weren't yet sure whether this bug was reproducible in development/QA, or was only triggerable in production, so using techniques that worked directly on the running image was attractive.
Re: Tracking down a memory leak in Ruby's EventMachine
#6I wish there were more posts like this.
No product announcement links, no Valley gossip rag links, no endless picking apart of every tiny Apple and Google thing.
What makes HN special are posts about making things. Everything else is just the same chatter all the other tech sites have.
Re: Tracking down a memory leak in Ruby's EventMachine
#7I wish there were more posts like this.
Re: Tracking down a memory leak in Ruby's EventMachine
#8Like danso, I admire the detective-work here. I would like to point out, though, that XCode's Instruments utility has a fantastically useful "Leaks" mode that will identify leaked allocations, including a stack trace. It can attach to a running process and has a non-disastrous impact on performance, though like most such tools it's voracious for memory. Other platforms likely have similar tools, though I have yet to…
I wrote a frontend: https://github.com/kevingadd/HeapProfiler but you can also just invoke it manually from the shell and then capture the state of the heap at your leisure.