GC Handles constantly rising in YourKit, but not in Perfmon.

Questions about YourKit .NET Profiler
Post Reply
nevdelap
Posts: 2
Joined: Thu Sep 08, 2011 1:21 pm

GC Handles constantly rising in YourKit, but not in Perfmon.

Post by nevdelap »

Hi there,

I just starting using, and bought, YourKit today, so this might be just a newbie misunderstanding.

I've been investigating GC Handles issues when creating and unloading app domains.

With this tiny test app below the GC Handles count in YourKit rises by 34 handles for each CreateDomain/Unload. (The different app domain name is important.)

So this was alarming me.

But in PerfMon it goes up and down between about 4 and about 70, apparently not having much to do with the 5 second cycle of the CreateDomain/Unloads, and seemly fine.

So I'm wondering what GC Handles is indicating? (Since it seems to just be accumulating.)

Thanks!

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            for (int i = 0; i < 1000; i++)
            {
                var appDomain = AppDomain.CreateDomain(string.Format("Whatever{0}", i.ToString()));
                AppDomain.Unload(appDomain);
                Thread.Sleep(5000);
            }
        }
    }
}
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: GC Handles constantly rising in YourKit, but not in Perf

Post by Anton Katilin »

Hello,

We acknowledge the problem: the shown number of GC handles constantly grows with your example application.

We're investigating the issue.

Technically, the following CLR profiler API callbacks are used to count the number:

ICorProfilerCallback2::HandleCreated
http://msdn.microsoft.com/en-us/library/ms231189.aspx

and

ICorProfilerCallback2::HandleDestroyed
http://msdn.microsoft.com/en-us/library/ms232126.aspx

Best regards,
Anton
Post Reply