-
Notifications
You must be signed in to change notification settings - Fork 143
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
[wpe-2.28] Canvas 2D Graphics Memory leak for very simple demo #1434
Comments
Same issue seen with this Lightning app demo. https://github.com/mlapps/router-example-app |
We have now built with ENABLE_ACCELERATED_2D_CANVAS=OFF and this fixes the memory leak. Any idea why this option causes the memory increase/leak ? Thanks again! |
By setting ENABLE_ACCELERATED_2D_CANVAS=OFF you're telling the canvas not to use the GPU, and that's why the GPU memory doesn't grow, as it's not used. CPU memory is used instead. A drawback is that the canvas will be slower, but the relevance of this depends on your use case really. If you want to develop something like a game, where the framerate is important, it will be a problem. It you plan to show mostly static elements, then you'll be fine. Regarding the leak: we don't have reports of GPU mem being leaked with the canvas on 2.28. It doesn't mean that it can't happen but it would be curious that it wasn't detected before. Anyway, are you sure it's a leak? How long have you waited for the memory to be released? Cause it depends on when the garbage collection happens and such. |
Thanks for the info, didn't realise that setting actually determines if canvas uses GPU memory, makes sense. The reason I believe it is a leak is because I forced the system to run garbage collection at regular intervals but the GPU memory seems to never be released. Also using the Lightning demo I have used their GPU memory gc() method to force collection but again GFX memory doesn't decrease. It might be specific to the build options we use on our system, maybe why others have not reported similar. |
@magomez We are trying to disable the canvas2d acceleration by calling the setting from WebKitImplementation.cpp in rdkservices webkit_settings_set_enable_accelerated_2d_canvas() Any idea why this setting isn't working properly in webkit? |
@laurence-ejraee : I am checking it |
@pgorszkowski-igalia Thanks, I've managed to identify the issue. It's always set to true by default in our build by this line in WPEView.cpp: preferences->setAccelerated2dCanvasEnabled(true); |
Hi, I've created this simple demo and when testing the graphics memory increases and is never released.
For the image I just downloaded a 1920x1080 image from: https://picsum.photos/1920/1080
To test Press the Left key to draw the image, then press Enter key to remove the canvas/drawing.
When removed the graphics memory is not released, and doing Left, Enter combo repeatedly leads to graphics memory exhaustion.
Is there something else I need to do to release the canvas memory in webkit? Or is this a webkit bug? Maybe this is fixed on newer version e.g. 2.38 ?
Any help or info is much appreciated.
The text was updated successfully, but these errors were encountered: