Bug 249947

Summary: wpebackend-fdo appears to be leaking EGL images
Product: WebKit Reporter: otherbms <brett>
Component: WPE WebKitAssignee: Nobody <webkit-unassigned>
Status: RESOLVED MOVED    
Severity: Major CC: alex, aperez, bugs-noreply, mcatanzaro
Priority: P2    
Version: Other   
Hardware: Other   
OS: Linux   
Attachments:
Description Flags
fdo patch to free egl images none

Description otherbms 2022-12-29 12:27:31 PST
Created attachment 464250 [details]
fdo patch to free egl images

My understanding of the EGL image management in FDO is somewhat limited, but I believe that EGL images are being leaked when destroying webkit views. 

In my application I regularly call webkit_web_view_backend_new; this happens a lot because I create many separate webkit views and release them when no longer needed.

All EGL images that are consumed by the client (my code) are returned to FDO prior to webkit.view un-referencing using the wpe_view_backend_exportable_fdo_dispatch_frame_complete and wpe_view_backend_exportable_fdo_egl_dispatch_release_exported_image functions.


I notice that memory is consumed but not freed and upon investigation I found that EGL images were leaking.

The attached patch corrected my application and I'm submitting it for help here.
Thanks!
Comment 1 Michael Catanzaro 2022-12-29 15:40:55 PST
Hi, thanks for investigating this problem. This is not the right issue tracker though. Feel free to submit an issue report and pull request at https://github.com/Igalia/WPEBackend-fdo where it can be reviewed properly. Thanks!
Comment 2 Michael Catanzaro 2022-12-29 15:51:34 PST
BTW you'll want to look at https://github.com/Igalia/WPEBackend-fdo/pull/176, which introduced the leak, and https://github.com/Igalia/WPEBackend-fdo/pull/178, which seems to fix it. Maybe that #178 is all that's needed here? Not sure why it seems to be stalled.