Bug 187964 - ImageBitmap should report its memory cost
Summary: ImageBitmap should report its memory cost
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kimmo Kinnunen
URL:
Keywords: InRadar
Depends on:
Blocks: 229825
  Show dependency treegraph
 
Reported: 2018-07-24 10:53 PDT by Zan Dobersek
Modified: 2021-10-27 02:51 PDT (History)
13 users (show)

See Also:


Attachments
Patch (3.04 KB, patch)
2018-07-24 10:59 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (4.40 KB, patch)
2021-10-22 03:40 PDT, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2018-07-24 10:53:17 PDT
ImageBitmap should report its memory cost
Comment 1 Zan Dobersek 2018-07-24 10:59:52 PDT
Created attachment 345690 [details]
Patch
Comment 2 Simon Fraser (smfr) 2018-07-24 16:00:59 PDT
Comment on attachment 345690 [details]
Patch

This should be testable somehow, right?
Comment 3 Zan Dobersek 2018-07-25 10:53:05 PDT
(In reply to Simon Fraser (smfr) from comment #2)
> Comment on attachment 345690 [details]
> Patch
> 
> This should be testable somehow, right?

I don't know, I can't find a comparable test for e.g. HTMLCanvasElement.

The changes here primarily increase the reported memory cost of ImageBitmap objects, bringing down the delay in which GC is triggered. This helps destroying stale ImageBitmaps and underlying pixel data. Any pointers about how to test this are welcome.
Comment 4 Kimmo Kinnunen 2021-10-22 03:40:41 PDT
Created attachment 442145 [details]
Patch
Comment 5 Kimmo Kinnunen 2021-10-22 03:44:26 PDT
Taking the liberty to taking the bug, feel free to comment if you disagree.

For the test I could only find internals.memoryInfo() but didn't feel confident it was working since none of the tests use it..
I can add the test but I uploaded the patch if it's useful for bug 232139
Comment 6 Radar WebKit Bug Importer 2021-10-22 07:11:58 PDT
<rdar://problem/84548359>
Comment 7 EWS 2021-10-24 23:47:57 PDT
Committed r284772 (243481@main): <https://commits.webkit.org/243481@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442145 [details].