-
Notifications
You must be signed in to change notification settings - Fork 255
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
[BUG] Huge memory consumption when writing images to PDF #542
Comments
Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/ |
FYI, I am a licensed enterprise customer |
Hi @zenyui, Could you share the images that you load into golang |
Here is a google drive folder with a few pprof dumps and the source PDF. The larger algorithm is:
|
Thanks for the information, we will investigate this issue. |
Still waiting on a solution. |
@zenyui As for image extraction, we are actively working on that and and we will keep you updated on our progress. |
Hi @zenyui, We created a guide to solve the OOM situation by using the GOMEMLIMIT, which require go1.19, here the article https://unidoc.io/post/unipdf-with-go-memlimit-on-memory-intensive-application, hope that can help you to solve the OOM situation and would be great if we could got feedback on that. Best regards, |
Description
I am trying to create a PDF from an array of golang
image.Image
objects. The images are about ~30MB together, and when I write them to the PDF, I observe the docker container spike to 1.4GB memory usage.In production, this is causing my container to OOM and exit.
See implementation below.
Expected Behavior
I would expect the memory usage to be close to (or 2x, 3x) the size of the images, not 1.4GB! I also don't see a way to incrementally build/finalize the PDF, so I don't see a way to decrease the memory usage.
Actual Behavior
Memory usage is 1.4GB, and I don't see an avenue to accomplish what I'm hoping to do.
Attachments
The text was updated successfully, but these errors were encountered: