Memory leaks while rendering page asynchronously #17470
Unanswered
MallauryGerard
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
As many people, I'm experiencing a memory leak while rendering a whole PDF.
I try to render the first page of a PDF and then the others as I scroll.
The problem is that each time a page is rendered, the memory used increases by ~80MB and doesn't decrease any more.
After struggling with this problem for several hours, I realised that memory usage was decreasing using
page.cleanup();
each time a page is rendered.But this solution only works if you force the rendering to be synchronous. Because when running asynchronously, the "page" variable is already being used to render page 2 (for example) while I'm trying to cleanup page 1...
I don't know if the explanation is clear?
This is the code that frees up memory (synchronous):
Do you know how I could do this asynchronously?
Thans!
Beta Was this translation helpful? Give feedback.
All reactions