mixpanel/mixpanel-unity

Memory leak

gvuyk opened this issue · 1 comments

gvuyk commented

FPS decreases dramatically while on editor,
Unity reports this when the game stops:

A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Unity.Collections.NativeArray`1:.ctor(Byte[], Allocator) (at /home/bokken/buildslave/unity/build/Runtime/Export/NativeArray/NativeArray.cs:69)
UnityEngine.Networking.UploadHandlerRaw:.ctor(Byte[]) (at /home/bokken/buildslave/unity/build/Modules/UnityWebRequest/Public/UploadHandler/UploadHandler.bindings.cs:95)
UnityEngine.Networking.UnityWebRequest:SetupPost(UnityWebRequest, WWWForm) (at /home/bokken/buildslave/unity/build/Modules/UnityWebRequest/Public/WebRequestExtensions.cs:206)
UnityEngine.Networking.UnityWebRequest:Post(String, WWWForm) (at /home/bokken/buildslave/unity/build/Modules/UnityWebRequest/Public/WebRequestExtensions.cs:184)
mixpanel.<SendData>d__18:MoveNext() (at Library/PackageCache/com.mixpanel.unity@d8c94bb354/Mixpanel/Controller.cs:163)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at /home/bokken/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)
gvuyk commented

It seems the memory leak comes from using UnityWebRequest with the obsolete WWWForm. I've replaced it with a Dictionary<string, string> and it seems to work fine.

Original FPS drop was caused by an unrelated issue