w3wp profiling appears to hang

edited March 11, 2016 11:26AM in ANTS Performance Profiler 8
I am trying to profile our web application by attaching the performance profiler to w3wp.exe process. It works fine for profiling some short web service operation. But when I try to profile a longer running operation our application appears to hang. The profiler shows activity for a period of time as the operation starts. Then the activity drops to 0 (well before it should be completed). Meanwhile our application appears to be blocked or hung.

At this point I can attach to the application using VStudio (so it appears profile is no longer attached).

Running the same service operation without the profile works fine to completion.

Are there any limitations on what can be profiled? I am wondering if its an issue of our application running on multiple threads? Can that cause issues for the profiler?


  • Shooting from the hip, there's two things I know that might explain this.

    Firstly, the profiler generates *a lot* of data, is CPU intensive and often has it's wicked way with your code by injecting dynamic IL into it. So, now and again, profiling a long-running process just doesn't work. In such a case, you can either dial down the amount of information gathered (sampling mode is ideal for this) or profile in shorted bursts.

    Secondly, we have a known issue that there's a race condition deep in the process that only seems to arise in sampling mode(!).

    This is actually quite convenient since- if its failing in sampling mode, try something else; if its failing in the other mode, try sampling :)
  • I'm also experiencing the same thing. I launch our web (ASP.NET, C#) project via Visual Studio 2012 and then attach to the w3wp process in ANTS. I'm able to log in and do a few functions before the application and profiler both hang.

    Unfortunately, your suggestion re: trying something other than sampling mode isn't possible in 8.4 (Professional) as that option is set by default without the ability to change it.

    In order to get around it, I tried attaching it for only certain aspects of the code that I want to profile. However, even then I could only capture 2-3 functions before I have to restart both my dev environment and ANTS.

    Is there another way to profile the back end of an ASP.NET website (e.g., access controllers, factories, etc.) other than attaching to the w3wp process? Attempting the other methods results in profiling the front end (e.g., aspx) code.
  • I'm not sure why you can't profile using any other mode than sampling in the professional edition as you should be able to use method-level only etc- of course, don't select the option 'Attach to a .net process' use the more direct 'ASP.NET' or 'IIS' profiling option.
  • switching to using IIS profiling (I had been using attach to process) appears to help. It seems to be a little more finicky to get the profile to actually profile what I am doing. And haven't really done a long processing run yet, but it appears to be avoiding the hang now.
  • switching to using IIS profiling (I had been using attach to process) appears to help.

    Yes, thanks. Switching to IIS profiling works for me too.
    Have you tried https://dudehung.com/my-jes-extender-review-and-results the new Jes Extender.
Sign In or Register to comment.