Skip to content

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

Open

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

Activity

  1. blikblum commented on Jun 17, 2024

    @blikblum
    Member

    Can you provide a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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