porta icon indicating copy to clipboard operation
porta copied to clipboard

prawn memory leak workaround

Open akostadinov opened this issue 3 years ago • 0 comments

We can't easily upgrade prawn because of API changes that will require reimplementing of PDF generation code.

Issue was fixed upstream with prawnpdf/prawn#430 and described as:

It boils down to text.rb#L147 making use of a thread-local cache for character sizes of the current font. The Font objects don't implement #hash or #eql?, so different instances of the same font will end up creating different keys in the thread-local and thus growing the cache.

In our workaround, we just clear that cache after each PDF creation as that can be done externally without forking prawn. At some point we need to take the time and update to the latest prawn version.

fixes THREESCALE-8120

akostadinov avatar Sep 02 '22 11:09 akostadinov