ml5-library icon indicating copy to clipboard operation
ml5-library copied to clipboard

Possible memory leak in BodyPix and WEBGL

Open fbarretto opened this issue 2 years ago • 0 comments

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: Screenshot 2023-11-26 at 1 39 39 AM

Memory usage when starting the sketch (T0): Screenshot 2023-11-26 at 1 39 50 AM

Memory usage after 60 seconds (T60): Screenshot 2023-11-26 at 1 44 22 AM

Memory usage after 5 minutes (T300): Screenshot 2023-11-26 at 1 54 16 AM

→ 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

fbarretto avatar Nov 26 '23 05:11 fbarretto