Search Unity

  1. We would like to hear your feedback about Unity and our products. Click here for more information.
    Dismiss Notice

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

Discussion in '2019.1 Beta' started by Carpet_Head, Feb 18, 2019.

  1. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    97
    Code (CSharp):
    1. A Native Collection has not been disposed, resulting in a memory leak. Enable Full StackTraces to get more details.

    How do I enable Full Stacktraces? which Unity version supports this?
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    1,411
  3. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    97
    It doesn't seem to make any difference

    upload_2019-2-18_17-37-56.png
     
  4. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    97
    to elaborate: we are looking to find bugs in code we wrote that is leaking native collections. It is a complex system so it is hard to track down the issues without seeing where the collections were created
     
  5. elcionap

    elcionap

    Joined:
    Jan 11, 2016
    Posts:
    51
    Menu Job/Leak Detection/Full Stack Traces (Expensive)
    I'm not sure about leaks before the activation so maybe you'll need to restart the editor after enabled.

    []'s
     
  6. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    97
    Thanks!

    I still couldn't find it - looks like you have to enable the Entities package explicitly to get this option. Burst and Collections are not enough on their own.
     
  7. scobi

    scobi

    Unity Technologies

    Joined:
    May 14, 2014
    Posts:
    27
    It's actually the com.unity.jobs package that provides this menu - but com.unity.entities uses it as a dependency, so bringing in Entities will also work.

    I'll write up a bug for us to make the situation better. It's obviously weird that you have to bring in a package to enable debugging something in the core. At minimum, we'll make it a more useful error message. Sorry for the trouble!
     
    peteyhayman and elcionap like this.
  8. DropNodes

    DropNodes

    Joined:
    Jun 11, 2019
    Posts:
    2
    So enabling this stops the error message, but I don't see how to check if/where I have a memory leak