You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WebRender + Canvas repaints cause huge memory leak. #11062
I've made a simple test page for this issue, and when any of the three actions in the JS is performed (setting canvas size, clearing canvas or drawing randomized lines) in a fast loop (works with setInterval and requestAnimationFrame), the memory usage goes up to a gigabyte in somewhere around a minute.
I also tested it with WebRender disabled and it seems not to occur then. The command I used to launch it was "./mach run -r -w [filename]".
Yep, that's the case I think, webrender images allocated with WebRender's alloc_image/update_image are never removed from WebRender's resource cache.
@glennw: I can take the time for doing the image deallocation patches, is there anything special that could prevent that?
I can think of a few races that might happen, like webrender not having rendered yet the old frame before we deallocate the image or something like that, but haven't done any analysis so I better go do it and see if there's any crash like that.
Activity
[-]WebRender + Canvas repaints causes huge memory leak.[/-][+]WebRender + Canvas repaints cause huge memory leak.[/+]Zaggy1024 commentedon May 7, 2016
Forgot to say, my system specs are:
Windows 10 64-bit
Intel i7 5820K
GeForce GTX 970, driver version 364.72 (as reported by GeForce Experience)
This may or may not be limited to Windows, as @ConnorGBrewster says its memory usage on his system is staying at 70-80 MB.
emilio commentedon May 7, 2016
cc @glennw, might we be forgetting of dropping webrender textures or other resources associated to 2d canvases when the canvas is flushed?
With WebGL this might not happen, since the code path used for webrender its radically different.
emilio commentedon Jun 15, 2016
Yep, that's the case I think, webrender images allocated with WebRender's
alloc_image/update_imageare never removed from WebRender's resource cache.@glennw: I can take the time for doing the image deallocation patches, is there anything special that could prevent that?
I can think of a few races that might happen, like webrender not having rendered yet the old frame before we deallocate the image or something like that, but haven't done any analysis so I better go do it and see if there's any crash like that.
canvas: Deallocate WebRender images on canvas
canvas: Deallocate WebRender images on canvas
Auto merge of #11750 - emilio:canvas-leaks, r=glennw