Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak when playing video on firefox browser #26527

Closed
danyjf opened this issue Aug 2, 2023 · 5 comments
Closed

Memory leak when playing video on firefox browser #26527

danyjf opened this issue Aug 2, 2023 · 5 comments

Comments

@danyjf
Copy link

danyjf commented Aug 2, 2023

Description

When opening a three.js example from the three.js website on firefox (version 116.0) the memory usage shown on task manager keeps increasing.

Reproduction steps

  1. Open firefox
  2. Go to one of the three.js video examples
  3. Open task manager
  4. Look at the firefox memory usage

Code

The code is in the three.js examples.
From my tests the leak happens when rendering a mesh with a material that uses a THREE.VideoTexture as the map parameter.

Live example

Screenshots

Screenshots from playing video on this example.

Memory before playing video:
image

Memory after 2 minutes of playing video:
image

Memory after 5 minutes of playing video:
image

Version

r155

Device

Desktop

Browser

Firefox

OS

Windows

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 2, 2023

There was a recent change in dev in context of video textures. Do you mind checking if the memory leak happens with the following URL as well:

https://rawcdn.githack.com/mrdoob/three.js/dev/examples/webgl_video_panorama_equirectangular.html

@danyjf
Copy link
Author

danyjf commented Aug 2, 2023

That change seems to have fixed it, the memory leak doesn't happen on the example from that url.
Is there any idea of when this change will be released?

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 2, 2023

With the upcoming release r156 end of this month. If you want to cherry pick the change, it is #26521.

However, you can also enhance the material that uses the video texture with onBeforeCompile() like shown in the code example in #26516 (comment).

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 3, 2023

@danyjf Do you mind reporting this issue to Mozilla at https://bugzilla.mozilla.org/ ?

I'm on macOS and could not reproduce the memory leak with the above examples. When testing webgl_video_panorama_equirectangular the memory of the tab stays around 75MB.

image

So maybe this issue is Windows exclusive and related to the DirectX backend of Firefox.

@danyjf
Copy link
Author

danyjf commented Aug 17, 2023

I was traveling when I saw this comment and only had access to my laptop, but when I tested on my laptop (which is also running windows 11 with same version of Firefox), the memory leak didn't happen.

When I got back home tested again on my desktop PC and the memory leak was still happening on it.
Decided to try updating the graphics drivers and that seems to have fixed it for me!

Graphics card: AMD Radeon RX 6700 XT.
Old driver version: 22.40.57.02 Adrenalin Edition (Most recent version at the beginning of January 2023 when I installed it)
Updated driver version: 23.10.23.02 Adrenalin Edition (The most recent version available as of 17 August 2023)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants