Search Unity

A Native Collection has not been disposed, Enable Full Stack?

Discussion in 'Entity Component System' started by castor76, Apr 25, 2021.

  1. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I have case where :

    A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details.

    error spawns. The error suggests that I shoud enable full stack trace. Which I have done, but it does not help to identify or find more information about the related error.

    No matter the stack trace level for debug console, the message stays the same and there are no more info, detail about the error. This is not very helpful, so what else can we do?
     
  2. Yumby

    Yumby

    Joined:
    Aug 17, 2012
    Posts:
    20
    You need to install the com.unity.jobs package in the package manager and then enable through the Jobs menu installed with the package. I was not able to find this package in the package manager registry but was able to locate it by searching fir the full name com.unity.jobs.
     
  3. Baggers_

    Baggers_

    Joined:
    Sep 10, 2017
    Posts:
    98
    @castor76 the menu you need to enable full stack traces in in this one:
    upload_2021-4-27_18-56-49.png
    If you don't have the 'Jobs' menu you'll need to do as @Yumby said.

    I can't remember, but it may require you to to enable preview packages:
    upload_2021-4-27_18-59-45.png
     
    lavagoatGG and MonsW like this.
  4. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I see!, Got it and much thanks!
     
  5. MontanaAnton

    MontanaAnton

    Joined:
    Feb 16, 2014
    Posts:
    14
    I got this problem in "Unity 2020 version"
    when i use WWW requests
    Code (CSharp):
    1. WWW www = new(url, request.BytesData, request.headers);
    i just added Using and it fixed thiss issue
    Code (CSharp):
    1. using (WWW www = new(url, request.BytesData, request.headers)){}