-
-
Notifications
You must be signed in to change notification settings - Fork 942
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 (256MB)” error on iPad using big canvas #571
Comments
How many layers do you have? Do you use caching? |
I'm using just one layer. But I didn't use caching. I'll take a look. Anyway, I can't find a clear way to fix this issue. I'll continue trying and I'll keep this updated with my progress. I don't know if someone is dealing with the same problem. |
@SWebDevelop So it seems max size is 1024x1024 for iOS in Safari |
I had this issue a long time ago. I reduced canvas usage and that helped me. Fill free to add more info, if you have it. |
I think this is an issue of Safari. Please check here |
I had that issue |
You need to profile memory. See what exactly consumes that much. |
@lavrton Thanks for your response. I checked and the HTMLCanvas is increasing size. Does it enough information for providing solution? |
Well, solution is on your side. You see that a lot of HTMLCanvasElements are in memory. Do you use cache a lot? Do you destroy shapes correctly? Do you destroy stages? |
Hey @lavrton. After a few iterations, I also get a memory problem on iOS - and only on iOS. The number of canvases remains high, despite destroy & remove. |
Must correct: Just tested on macOS. |
Just built a sandbox to rule out the error on my part: And surprise: It works as it should. Safari clears the memory correctly. I searched further in my application: I managed Konva-Stages in React.useState. In doing so, shallowCopys were created. Sorry :) Maybe this helps anyways. |
@VForsmann I made PR recently, #1442. I don't use cache(), but in my SPA I create/remove different stages (render via |
I have a KonvaJS app with a "draw" functionality. On the mouse move event, I'm creating a new Line and adding points to it.
It works perfect on Desktop but it crashes on iPad. This is the issue that I get:
Total canvas memory use exceeds the maximum limit (256MB)
It's fired on this part of the KonvaJS library:
The line that fires the error is:
this.getContext()._context.scale(e, e)
This error only happen when I'm using a big canvas size (example: 1200x1500px).
Any ideas of how to fix this issue?
Thanks in advance!
The text was updated successfully, but these errors were encountered: