Currently resources used by UnityWebRequest in ColyseusRequest aren't disposed and this can cause a memory leak in newer versions of Unity. I've only tested this on Unity version 2021.2.0a17.2411 (yeah I know, alpha! 😄) but there has been reports about the same issue happening with other versions of Unity as well.
According to Unity documentationUnityWebRequest must be disposed after it's been used.
Using declaration fixed the issue on my machine. Probably needs a bit more testing to be sure!
using UnityWebRequest req = new UnityWebRequest();
Currently resources used by
UnityWebRequest
inColyseusRequest
aren't disposed and this can cause a memory leak in newer versions of Unity. I've only tested this on Unity version 2021.2.0a17.2411 (yeah I know, alpha! 😄) but there has been reports about the same issue happening with other versions of Unity as well.According to Unity documentation
UnityWebRequest
must be disposed after it's been used.Using declaration fixed the issue on my machine. Probably needs a bit more testing to be sure!
using UnityWebRequest req = new UnityWebRequest();
Here's the stack trace: