ueno / ruby-gpgme

a ruby interface to GnuPG Made Easy (GPGME).
GNU Lesser General Public License v2.1
232 stars 99 forks source link

Cannot allocate memory Error #147

Open junjchen opened 2 years ago

junjchen commented 2 years ago

Hi,

I am getting Errno::ENOMEM: Cannot allocate memory errors when trying to use this gem to decrypt text from a large size dataset. The data set contains 25k rows and this error started to appear after processing around 11k rows.

Container running the worker still has a lot of unused RAM so I dont believe system memory is the issue here. I also tried setting auto-expand-secmem in .gnupg/gpg-agent.conf but it didnt help either.

Would really appreciate if anyone can provide a direction as to what could have caused this issue.

Error stack

/usr/src/app/vendor/bundle/ruby/2.7.0/gems/gpgme-2.0.20/lib/gpgme/ctx.rb:435:in `decrypt_verify'
/usr/src/app/vendor/bundle/ruby/2.7.0/gems/gpgme-2.0.20/lib/gpgme/crypto.rb:172:in `block in decrypt'
/usr/src/app/vendor/bundle/ruby/2.7.0/gems/gpgme-2.0.20/lib/gpgme/ctx.rb:79:in `new'
/usr/src/app/vendor/bundle/ruby/2.7.0/gems/gpgme-2.0.20/lib/gpgme/crypto.rb:170:in `decrypt'