Open lekoder opened 5 years ago
Would be great to add option to disable cache for rendering large documents.
Would be great to add option to disable cache for rendering large documents.
I will do it.
Another option is to use Map since it can get more keys: https://code.i-harness.com/en/q/1f5cefa
It would be helpful to provide an example so we can test the performance with plain object and Map
Added. I'd like the opinion about the name. Technically is a fontLayoutCache but the layout is a implementation detail that regular users should not be aware
Bug Report
Description of the problem
When generating large document (40k+ pages) with custom font and lots of unique strings, the embeded font layout cache takes up all available memory due to being populated by unique "words". This eventually causes application crash due to out of heap memory error.
Your environment
Use case
Bank statements, accounting reports and other similar documents tend to have lot of unique strings (identifiers, balances, URLs, etc) and are simultaneously very large.
Workaround
An usable workaround was found: passing
{ features:[] }
to.text()
disables the cache and allows generation of document.