[PR #2325] [MERGED] fix: memory leak in PDF to images conversion #2216

Closed
opened 2026-02-26 20:32:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/2325
Author: @Mythie
Created: 12/16/2025
Status: Merged
Merged: 12/16/2025
Merged by: @Mythie

Base: mainHead: fix/pdf-to-images-memory-leak


📝 Commits (1)

  • fdbbb54 fix: memory leak in PDF to images conversion

📊 Changes

1 file changed (+11 additions, -4 deletions)

View changed files

📝 packages/lib/server-only/ai/pdf-to-images.ts (+11 -4)

📄 Description

Add proper cleanup for PDF.js pages and loading task to prevent memory leaks when
processing multiple PDF pages. Ensure page cleanup is called after each page is
rendered and both PDF document and loading task are properly destroyed with error
handling.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/2325 **Author:** [@Mythie](https://github.com/Mythie) **Created:** 12/16/2025 **Status:** ✅ Merged **Merged:** 12/16/2025 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `fix/pdf-to-images-memory-leak` --- ### 📝 Commits (1) - [`fdbbb54`](https://github.com/documenso/documenso/commit/fdbbb5429fd6c78c3820db101bdb0bb988bc2718) fix: memory leak in PDF to images conversion ### 📊 Changes **1 file changed** (+11 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/lib/server-only/ai/pdf-to-images.ts` (+11 -4) </details> ### 📄 Description Add proper cleanup for PDF.js pages and loading task to prevent memory leaks when processing multiple PDF pages. Ensure page cleanup is called after each page is rendered and both PDF document and loading task are properly destroyed with error handling. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 20:32:56 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#2216
No description provided.