Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4565244
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:36:57+00:00 2026-05-21T18:36:57+00:00

After running the VS2010 profiler with Object Lifetime Tracking in my app, I have

  • 0

After running the VS2010 profiler with Object Lifetime Tracking in my app, I have this on a particular class :

Number of Instances———-1 418 276

%Total Instances ——————— %5.8
Total Bytes Allocated ——- 158 846 912
%Total Bytes ————————– %5.94
Gen 0 Instances Collected ——— 5 196
Gen 1 Instances Collected ——–54 894
Gen 2 Instances Collected —-747 874

Instances Alive At End ——— 610 312

Gen 0 Bytes Collected ———– 581 952
Gen 1 Bytes Collected ———6 148 128
Gen 2 Bytes Collected ———3 761 888

As you cans see, half of all created instances end up mainly as Gen 2, and the other half is staying alive until the end of the App. [ha, ha, ha, ha, staying alive, staying alive… -> Ok sorry, I could’nt resist…]

What bothers me is that these instances should have a very short lifetime (It’s basically a datafield class – that could be a struct, but I preferred to make it a class to “activate” GC on it).

These instances are created by reading very large binary files (each line being a class/ a record) and passed via a small sized queue by delegate/event to workers that basically just read it, put it in queues (which are very regularly dequeued), and then terminate (background workers ending normally). I guess Events are unsubscribed to when workers no more exist.

So, is there a way to identify where are these references hiding ? Because if they are not GC’d they ARE still referenced somewhere, but how to tell for sure ? I’m tired of guessing and trying so many hypothesis SO if somebody has more rational guidelines or a fair checklist and/or tools / precise profiler places to look at, I welcome it.

Complementary Resources to the Answers
Visual GCRoot via DGML – Thanks to Richard Szalay
Also, this video GCRoot Demo from Chris Lovett is very educative on the subject.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T18:36:58+00:00Added an answer on May 21, 2026 at 6:36 pm
    1. Enable Unmanaged Debugging in the “Debug” tab of your project properties
    2. Run the application and set a breakpoint at a point where you want to investigate the types
    3. In the Immediate window, type:
    .load sos
    !DumpHeap -type <partial type name>
    

    This will return something like:

     Address       MT     Size
    026407c0 53ecee20       16     
    

    Then you can take the Address and use GCRoot to find the where it’s rooted:

    !GCRoot 026407c0
    

    Chris Lovett (via Tess Ferrandez) created a very neat utility that converts the low-level GCRoot output into a DGML graph which might make it easier to diagnose.

    Alternatively, Mohamed Mahmoud created a debugger extension that enables you generate the graph from WinDBG, but it doesn’t work within Visual Studio so you might want to stick to Chris’s utility to avoid installing the Debugging Tools.

    Having said that, the textual output may well be enough for you to track things down. If you want information on the output of GCRoot, type !help GCRoot in the immediate window.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do you make the documentation available after running rake doc:app available within your
Similar to this question , after running the following code the browser dialog does
After running Code Analysis in VS2010 beta (FxCop for previous versions) I'm getting the
i have a class in c# (.net 3.5 cp, vs2010) which executes complex comuptations
I have VS2010 up and running with SVN integration using the AnkhSVN client which
I have a VS2010 running on a WTS machine (Windows2008). I'm trying to attach
After running the code below I get this output: Eve 1200 Could anyone explain
After running a insert or update query against a SQLServer 2005 database, under what
After running some usability tests, I found that participants opened a jQuery Lightbox to
After running a model in fortran (95) I end up with some result arrays

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.