Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PDFObjectParser.ts #1653

Closed
wants to merge 1 commit into from
Closed

Conversation

UnderKoen
Copy link

@UnderKoen UnderKoen commented Jul 17, 2024

What?

Closes an memory leak.

Why?

When combing many large PDF's the memory usage is through the roof.

How?

By creating an new buffer instead of an view the reference to the orginal buffer is removed and can be picked up on garbage collection.

Testing?

New Dependencies?

No

Screenshots

N/A

Suggested Reading?

No

Anything Else?

Checklist

  • I read CONTRIBUTING.md.
  • I read MAINTAINERSHIP.md#pull-requests.
  • I added/updated unit tests for my changes.
  • I added/updated integration tests for my changes.
  • I ran the integration tests.
  • I tested my changes in Node, Deno, and the browser.
  • I viewed documents produced with my changes in Adobe Acrobat, Foxit Reader, Firefox, and Chrome.
  • I added/updated doc comments for any new/modified public APIs.
  • [z] My changes work for both new and existing PDF files.
  • I ran the linter on my changes.

Prevent memory leak
@UnderKoen
Copy link
Author

After some more testing I don't think this is the solution to the problem. When an Buffer (Node) is supplied this is an issue because Node slice returns an view.

@UnderKoen UnderKoen closed this Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant