Skip to content

media elements that are played to the end and have no other references should be GCed #49351

Closed

Description

@jschwe

Describe the bug:

#48979 fixed the case that media elements would be GCed too quickly, but they still should be GCed if the element finished playing (and no other references exist).
Leaktest should be added.

To Reproduce:
verified LLM generated reproducer, not posting due to project policy.

Platform:
Specify OS, distribution, and hardware platform.

Activity

  1. added
    I-memory-leak
    C-needs-test
    on Oct 28, 2026
  2. TimvdLippe commented on Oct 28, 2026

    @TimvdLippe
    Contributor
  3. TimvdLippe commented on Oct 28, 2026

    @TimvdLippe
    Contributor

    Leak tests can be added to https://github.com/servo/servo/tree/main/tests/wpt/mozilla/tests/memory I think we should move tests/wpt/mozilla/tests/mozilla/playing_media_no_gc.html into that directory and modify it to be:

            await TestUtils.gc();
            await TestUtils.gc();
            assert_not_equals(weakElem.deref(), undefined);
            // Wait for the audio to have finished playing
            await p2;
            // Ensure that after it has finished playing, it is properly cleaned up
            await TestUtils.gc();
            await TestUtils.gc();
            assert_equals(weakElem.deref(), undefined);
  4. sabbCodes commented on Oct 28, 2026

    @sabbCodes
    Contributor

    2. FYI @sabbCodes

    Thanks for the mention.

    Will take it.
    @servo-highfive: assign me

  5. added
    C-assigned
    on Oct 28, 2026
  6. servo-highfive commented on Oct 28, 2026

    @servo-highfive

    Hey @sabbCodes! Thanks for your interest in working on this issue. It's now assigned to you!

  7. added a commit that references this issue on Oct 28, 2026
    812d247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-content/mediaC-assignedC-needs-testI-memory-leak

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions