-
Notifications
You must be signed in to change notification settings - Fork 10.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
"Total canvas memory use exceeds the maximum limit (256 MB)" error in safari 12 and above #11297
Comments
Duplicate of #11245.
Furthermore, that's not an official release and in any case that version is a few years old and consequently no longer supported. |
I replaced the old version with 2.3.200, and apply the fix of fix of 11245, the issue still exists. |
2.3.200 also doesn't contain the fix from that issue yet. I would suggest waiting for the next release or cherry-picking the fix if need be. Closing since this should be fixed then. |
Thanks for your reply. I applied the fix of 11245 in 2.3.200, and my issue is not been fixed. On iPad OS 12.1.4, the isIOS() check works OK before the fix, userAgent match the /IPAD/ check. I appreciate if you can do more investigation. |
I was having a similar issue when I embedded the viewer in my app. There is a known issue with Safari that prevents garbage collection of canvases. There's already code in place that has a workaround to force memory to clear when scrolling through the PDF (PDFPageView.reset): Lines 185 to 188 in 693240c
However, this code wasn't being run when I closed the viewer, so I added the following code before closing the viewer:
I don't have enough experience with this project to know if there are any edge cases where this causes issues, but in our testing nothing has come up and we no longer have a memory leak. |
Line 46 in 7b23476
I workaround by reduce |
I am running into the same issue. Is there a fix available? I am using |
We run into the same issue on IOS Safari. @mobiusy did you find a way to solve it? |
|
I am facing the same issues with IOS 15.1 in iPhone and Mac Check detail over here |
a related article https://pqina.nl/blog/total-canvas-memory-use-exceeds-the-maximum-limit/ |
Given that we (obviously) cannot fix |
All PDF files have this issue.
PD216484A.pdf
Configuration:
Steps to reproduce the problem:
What is the expected behavior?
Expected the pdf shows correctly event user do not close previous tab.
What went wrong?

Got errors in browser inspector:
More info:
Is this a safari bug or pdf.js has workaround to avoid blank pages?
The text was updated successfully, but these errors were encountered: