Skip to content

Conversation

@eokoneyo
Copy link

Summary

Modify implementation to add image to pdf creates new transferrable image buffer, so that buffers that get sent to reporting worker will always get detached and free up memory on the main thread.

Informed from https://github.com/elastic/kibana/pull/205983/files#r1929384942

}
}

myPort.postMessage(generatePdfRequest, this.transferList);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we ensure the buffers added to this list are transferable, it should be fine to simply pass them along. I wonder if after doing this we still need the former safe guard especially that we also have tests in place

@eokoneyo eokoneyo changed the title Ensure image buffers to the worker spun to generate a PDF request is transferrable Ensure image buffers passed to the worker spun to generate a PDF request is transferrable Jan 27, 2025
Copy link
Owner

@jbudz jbudz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@jbudz jbudz merged commit a00e0d6 into jbudz:node-22 Jan 28, 2025
1 check passed
@eokoneyo eokoneyo deleted the node-22 branch March 1, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants