Visual Studio 2008 Profiling Object Lifetime RRS feed

  • General discussion

  • I have been reviewing the object lifetime information about my app but I am wondering what the following means: The sum of all Garbage Collected objects and Alive at end objects is greater than Instances. I'm wondering how can I track down these missing object creations?

    For example:

    Class Name Instances Total Instances % Total Bytes Allocated Total Bytes % Gen 0 Instances Collected Gen 0 Bytes Collected Gen 1 Instances Collected Gen 1 Bytes Collected Gen 2 Instances Collected Gen 2 Bytes Collected Large Object Heap Instances Collected Large Object Heap Bytes Collected Instances Alive At End
    System.UInt16[] 15 0.03 600 0.02 69 2,760 0 0 1 40 0 0 0

    Total instances is 15 but GC Gen 0 Collected 69 and Gen 2 collected 1. It just doesn't add up.

    Thursday, November 1, 2012 1:01 AM

All replies

  • Hi Dessert,

    Thank you for posting in the MSDN forum.

    Instance data:  Indicate the number of objects of the type that were created in the profiling run, and the generation in which the objects were deallocated by the garbage collector.

    If you want to know more about the Instance data, please see this MSDN document “Object Lifetime View”. Hope it could help.

    Have a nice weekend,

    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Friday, November 2, 2012 5:55 AM
  • Thank you for providing the definitions but I still do not understand how the GC can collect more than were created.
    Friday, November 2, 2012 5:03 PM
  • Hi Dessert,

    Glad to receive your reply.

    To repro this issue, would you mind sharing us a sample? We will try to profile this app in my Environment.

    Please also attach your Visual Studio project, you can upload it to the sky driver, and then share the download link in your post. Please also attach a screenshot image about your report result in your reply. Thanks for your understanding.


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Monday, November 5, 2012 5:58 AM