Skip to content

Cache using all available memory in large document with unique strings #932

@lekoder

Description

@lekoder

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

  • pdfkit version: 0.8.3
  • Node version: v10.6.0

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions