paulschreiber / pdf-merger

Merge PDFs using iText.
http://github.com/paulschreiber/pdf-merger
MIT License
48 stars 15 forks source link

Memory Leak #4

Open KevinColemanInc opened 11 years ago

KevinColemanInc commented 11 years ago

We found a memory leak with RJB. We think the ruby can't do garbage collection on objects in lines 26-28 in https://github.com/paulschreiber/pdf-merger/blob/master/lib/pdf/merger/rjb.rb because the JVM is outside of ruby's domain.

If you need to process a large number of pdfs, you may need to restart your program a few times.

paulschreiber commented 11 years ago

Is there anything I can do to work around this? Have you filed a bug against rjb?

KevinColemanInc commented 11 years ago

I am not really sure... From what I have read, RJB inherently has issues with memory leaks.

I haven't tested this yet, but I think that Prawn can do pdf merges by setting the template of a page to a pdf file.

source: http://idhra.com/blog_posts/17-Merge-PDF-documents-with-Prawn