Possible memory leak in BodyPix and WEBGL
Dear ml5 community,
I'm submitting a new issue. Please see the details below.
→ Step 1: Describe the issue 📝
I've been using the bodypix model and realized that it seems to be a memory leak going. Running the bodypix webcam example with WEBGL render causes the Chrome (GPU) to continuously increase the memory usage until WEBGL loses context and crashes.
WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost
Could you please point me out in the right direction on how to fix this?
→ Step 2: Screenshots or Relevant Documentation 🖼
I've tried to run the vanilla example (as is) and then updated ml5 and p5js versions to the latest, with same results.
Memory usage when idle:
Memory usage when starting the sketch (T0):
Memory usage after 60 seconds (T60):
Memory usage after 5 minutes (T300):
→ Step 3: Share an example of the issue 🦄
Here's an example code of this issue.
→ Describe your setup 🦄
- Web browser & version: Chrome Version 119.0.6045.159 (Official Build) (arm64)
- Operating System: MacOS Ventura 13.0.1 (22A400)
- ml5 version you're using: Latest
- P.S: Same behavior on Safari@MacOS and Chrome@Windows11