Search Unity

Bug A Native Collection has not been disposed, resulting in a memory leak

Discussion in 'Scripting' started by lucaswhitaker22, May 8, 2021.

  1. lucaswhitaker22

    lucaswhitaker22

    Joined:
    Jun 3, 2018
    Posts:
    2
    Hello,

    I recently installed the Google Play Service Library from Github. When I set it up, the following error message appeared:

    It's non-critical, as my game still runs. However, a memory leak doesn't sound good, so I would like to fix it. Unfortunately, I have no idea how to deal with something like this (i'm a first year software eng student, so this is all new to me).

    Does anyone know what may be causing this error? Is their a simple solution or do I need to run a memory profiler?

    A Native Collection has not been disposed, resulting in a memory leak. Allocated from:

    Unity.Collections.NativeArray`1:.ctor(Byte[], Allocator) (at /Users/bokken/buildslave/unity/build/Runtime/Export/NativeArray/NativeArray.cs:69)

    UnityEngine.Networking.UploadHandlerRaw:.ctor(Byte[]) (at /Users/bokken/buildslave/unity/build/Modules/UnityWebRequest/Public/UploadHandler/UploadHandler.bindings.cs:98)

    UnityEngine.Networking.UnityWebRequest:SetupPost(UnityWebRequest, WWWForm) (at /Users/bokken/buildslave/unity/build/Modules/UnityWebRequest/Public/WebRequestExtensions.cs:206)

    UnityEngine.Networking.UnityWebRequest:Post(String, WWWForm) (at /Users/bokken/buildslave/unity/build/Modules/UnityWebRequest/Public/WebRequestExtensions.cs:184)

    System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)

    System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

    System.Reflection.MethodBase:Invoke(Object, Object[])

    Google.PortableWebRequest:StartRequest(HttpMethod, String, IDictionary`2, WWWForm) (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/VersionHandlerImpl/src/PortableWebRequest.cs:481)

    Google.<StartRequestOnMainThread>c__AnonStorey6:<>m__C() (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/VersionHandlerImpl/src/PortableWebRequest.cs:443)

    /Users/chkuang/Workspace/Git/unity-jar-resolver/source/VersionHandlerImpl/src/PortableWebRequest.cs:443)

    Google.RunOnMainThread:ExecuteNext() (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:486)

    Google.RunOnMainThread:<ExecuteAllUnnested>m__12() (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:536)

    Google.RunOnMainThread:RunAction(Action) (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)

    Google.RunOnMainThread:ExecuteAllUnnested(Boolean) (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)

    Google.RunOnMainThread:ExecuteAll() (at /Users/chkuang/Workspace/Git/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:512)

    UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:327)
     
  2. Chethan007

    Chethan007

    Joined:
    Dec 3, 2020
    Posts:
    57
    Even I am facing the same error. Seriously is there no one to solve this? My game is crashing as soon as I am starting it
     
    That_Mason_Guy likes this.