aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
699 stars 473 forks source link

Memory leak on meetingSession.audioVideo.start() #2916

Open NirmalmaheshSubramani opened 3 days ago

NirmalmaheshSubramani commented 3 days ago

What happened and what did you expect to happen?

I am using amazon-chime-sdk-js to create voice meetings. As soon as I call meetingSession.audioVideo.start(); It is creating the DedicatedWorkerGlobalScope in the JS Heap memory.

This Heap object is not cleaned up and keep on added for every new invocation of meetingSession.audioVideo.start().

image

Have you reviewed our existing documentation?

Reproduction steps

const startMeeting = async () => { if (!service.meetingSession) { console.warn('DEBUG: Meeting session not found'); return; } service.meetingSession.audioVideo.start(); };

Amazon Chime SDK for JavaScript version

3.19.0

What browsers are you seeing the problem on?

Chrome

Browser version

Version 126.0.6478.63 (Official Build) (arm64)

Meeting and Attendee ID Information.

No response

Browser console logs

NA

NirmalmaheshSubramani commented 3 days ago

Noticed there is an existing bug in the amazon-chime-sdk-ios for the same issue

https://github.com/aws/amazon-chime-sdk-ios/issues/570

xuesichao commented 2 days ago

Hi @NirmalmaheshSubramani , I couldn't reproduce this issue using our meetingV2 browser demo. Could you give it a try there? https://github.com/aws/amazon-chime-sdk-js/tree/main/demos/browser

I also noticed that when taking a heap snapshot, the dedicated worker persists. It's released if I'm not taking heap snapshot.