Skip to content

WebRender + Canvas repaints cause huge memory leak. #11062

Closed

Description

@Zaggy1024

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]".

CanvasTest.zip

Activity

  1. changed the title [-]WebRender + Canvas repaints causes huge memory leak.[/-] [+]WebRender + Canvas repaints cause huge memory leak.[/+] on May 7, 2016
  2. added
    I-perf-bloat
    on May 7, 2016
  3. Zaggy1024 commented on May 7, 2016

    @Zaggy1024
    ContributorAuthor

    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.

  4. added
    I-perf-slow
    on May 7, 2016
  5. emilio commented on May 7, 2016

    @emilio
    Member

    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.

  6. emilio commented on Jun 15, 2016

    @emilio
    Member

    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.

  7. added a commit that references this issue on Jun 15, 2016
    729fe36
  8. added a commit that references this issue on Jul 11, 2016
    b7d45fe
  9. added a commit that references this issue on Jul 11, 2016
    1ff8d87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/canvasI-perf-bloatI-perf-slow

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions