Skip to content

Please use lru to cache font layout to fix memory leak #1527

Open
@abihf

Description

@abihf

Bug Report

Description of the problem

There's memory leaks when using custom fonts with huge data. I can disable fontLayoutCache but the performance is 3x slower.

I think we should use lru instead of simple object here

Code sample

//TODO:

Your environment

  • pdfkit version: 0.15.0
  • Node version: 20.14.0
  • Browser version (if applicable): -
  • Operating System: Mac and Linux

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