-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Heap memory Leak | each PDF generation increase memory and does not fall back enough. #2848
Comments
Experiencing this issue as well in a production app. A co-worker of mine reached the same conclusion after tracking it down for 2 weeks. At least this double confirms it 😁 |
Hello @jaidetree Take into account that our app - simple Node.js app which provides an API endpoints to get data and render PDFs based on templates - so in our case its not a huge trick to call On real project you can try to add next line here: We going to run perf tests later to doublecheck but as for now - it works fine. Hope it may help you :) |
Thanks that's immensely helpful! |
Should be fixed by the latest yoga layout changes. Please try it out and re-open if this is not the case! |
Confirmed the fix is working on our end at least. Thanks! |
Thank you for fast reaction! |
First of all, thank you for such complicated tool! Awesome work!
Describe the bug
During performance testing we noticed memory leak. I tried to isolate the problem and could not found any reason other than using render function from react-pdf/renderer lib.
Every time a PDF is rendered, the memory used by the app increases and never comes back down to what it was before the rendering occurred. Garbage collector works but it seems like not enough objects deleted, seems like some objects still in use after generation finished.
Also i noticed that if we trying to get a lot of PDFs one after another fast - we will get yoga error and i do believe this problems are related(MaxListenersExceededWarning: Possible EventEmitter memory leak detected in yoga-layout)
PS. i saw previously closed issues but i did not found working solution and issue still exists for us in production.
To Reproduce
Steps to reproduce the behavior including code snippet (if applies):
Expected behavior
Memory should fall back in some time after PDF generation.
Screenshots
Desktop (please complete the following information):
Thank you in advance!
The text was updated successfully, but these errors were encountered: