AgoraIO-Community / Agora_Unity_WebGL

WebGL plugin for Unity, beta release
MIT License
111 stars 25 forks source link

[BUG] Browser - memory out of bounds #244

Closed tomaszwozniak123 closed 1 year ago

tomaszwozniak123 commented 1 year ago

Describe the bug There is memory out of bounds error in all browsers (Chrome, Firefox, etc.).

To Reproduce Steps to reproduce the behavior:

  1. Open scene with Agora screen share sample.
  2. Change to another scene.
  3. Repeat 1 and 2 several times.
  4. Restart application in browser
  5. When trying to open scene with Agora (or scene which needs more resources) error occurs. Build007.loader.js:80 exception thrown: RuntimeError: memory access out of bounds,RuntimeError: memory access out of bounds

Expected behavior No error

It looks like 'error is cached' somehow - when trying new build - it always happens. When using incognito - it happens until restarting browser.

I've narrowed my suspicions to _rtcEngine = IRtcEngine.GetEngine(_appId); When this is commented - everything works fine.

It looks like some kind of memory leak in IRtcEngine? Or maybe there is other method in dispose or rtcEngine?

tomaszwozniak123 commented 1 year ago

Additional hint: somehow I think it is connected with camera or microphone permissions - when not given it not happens.

nathanGroovy commented 1 year ago

I'm following your steps and trying to replicate the error, but I'm not getting any memory crash errors when switching scenes and restarting. Is there any extra code you've written that might effect how it runs maybe?

tomaszwozniak123 commented 1 year ago

Hi, I think it may be connected with VideoKit Natml - it is library that uses camera and microphone like Agora and maybe there is some conflict when both tries to use/init camera at the same time.

pon., 10 kwi 2023, 16:59 użytkownik Nathan Meier @.***> napisał:

I'm following your steps and trying to replicate the error, but I'm not getting any memory crash errors when switching scenes and restarting. Is there any extra code you've written that might effect how it runs maybe?

— Reply to this email directly, view it on GitHub https://github.com/AgoraIO-Community/Agora_Unity_WebGL/issues/244#issuecomment-1501920299, or unsubscribe https://github.com/notifications/unsubscribe-auth/A55PCJQ7VMQM5IDY4BHTJU3XAQN4HANCNFSM6AAAAAAWV6ECCQ . You are receiving this because you authored the thread.Message ID: @.***>

tomaszwozniak123 commented 1 year ago

It is solved - cause was something in VideoKit NatML, solved with 0.0.13 VideoKit release.