iragsdale / rubydkim

Ruby gem for creating & verifying DKIM signatures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Massive Memory Leak

pmamediagroup opened this issue · comments

Haven't been able to track this one down (not enough C experience, unfortunately).
Running on Ruby1.9, Linux (CentOS and Ubuntu), pushing roughly 5000 emails a minute. My memory usage goes from 29M to 300M in roughly 3 hours. I'd have to completely kill the process and restart it to work around this.

I'll try to take a look soon. Can you provide some simple sample code as a test case?

Hi,

I can confirm the bug on Ruby 1.8.7 Ubuntu Karmic x86 architekture. The heap gets bigger and bigger.

Just paste to the irb:

1000.times { s = DKIM::Signer.new('example.com', 'test', File.readlines('config/dkim.key').join); s.feed('123'); s.finish }; nil

Check memory usage before and after. On my machine RSS increases by about 4 megabytes.

I've finally figured this out. I assumed it must have been in my code, but it was actually a leak in the pdkim library I extended. I've sent the author a pull request, in the meantime a patched version is available here: https://github.com/iragsdale/pdkim