Runtime Flow blog (Understanding a control flow in a running .NET application)

October 15, 2013

Runtime Flow v1.3.5 released

Filed under: Uncategorized — Sergey Vlasov @ 6:52 am

Runtime Flow v1.3.5 released: added support for Visual Studio 2013 and added the ability to run without .NET 3 installed in Visual Studio 2010+.

Download link: Visual Studio edition.

Advertisements

September 6, 2012

Runtime Flow v1.3.4 released

Filed under: Uncategorized — Sergey Vlasov @ 6:10 am

Runtime Flow v1.3.4 released: fixed a problem with Visual Studio 2012 registration on 64bit Windows.

Download link: Visual Studio edition.

June 12, 2012

Runtime Flow v1.3.3 released

Filed under: Uncategorized — Sergey Vlasov @ 3:41 pm

Runtime Flow v1.3.3 released: added support for Visual Studio 2012 RC.

Download link: Visual Studio edition.

January 19, 2012

Monitoring a .NET application running in IIS

Filed under: Uncategorized — Sergey Vlasov @ 2:27 am

Runtime Flow can monitor a .NET application running in IIS, but currently it requires manual configuration and only one IIS worker process (w3wp.exe) can be monitored. Below are the steps I used to monitor a sample ASP.NET MVC2 application configured to use local IIS Web server, created in Visual Studio 2010 and running on Windows 7:

A sample MVC application in Visual Studio 2010 configured to use local IIS web server

A sample MVC application in Visual Studio 2010 configured to use local IIS web server

1. Enable profiling for w3wp.exe.

a) Find the application pool for the app.

Check IIS Manager, Sites – Default Web Site – MvcApplication1, Basic Settings. In my case the pool is DefaultAppPool:

Application pool in IIS manager

Application pool in IIS manager

b) Enable user profile loading for the pool.

IIS Manager, Application Pools, DefaultAppPool, Advanced Settings, Process Model – Load User Profile, set to True:

Application pools in IIS manager

Application pools in IIS manager


Advanced application pool settings

Advanced application pool settings

c) Find SID of the pool account.

From the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList key find ProfileImagePath with DefaultAppPool. In my case the SID is S-1-5-82-3006700770-424185619-1745488364-794895919-4004696415:

DefaultAppPool SID in registry

DefaultAppPool SID in registry

d) Set environment variables to invoke Runtime Flow profiler.

Using the found SID, add two string values to HKEY_USERS\S-1-5-82-3006700770-424185619-1745488364-794895919-4004696415\Environment:

Cor_Enable_Profiling=1
COR_PROFILER={C967CF3F-79BF-49a5-A10F-D5B269DB9E54}

Environment settings for DefaultAppPool

Environment settings for DefaultAppPool


Note that if you use IntelliTrace it can overwrite these registry values.

2. Close all running w3wp.exe processes.

In IIS Manager restart server.

3. Run monitoring.

In Runtime Flow – Customized Run, uncheck Stop monitoring when the command completes. Set Command to “C:\Program Files\Internet Explorer\iexplore.exe”. Set Command arguments to “http://localhost/MvcApplication1”. Optionally set Options – Monitoring Filter to “Module == MvcApplication1.dll”:

Customized run of Internet Explorer

Customized run of Internet Explorer


After you click Run, you will see how your application runs:
Runtime Flow monitoring results

Runtime Flow monitoring results

Update (July 28, 2018): For Windows 7 SP1 you may need to additionally edit the applicationHost.config file. See How to configure environment variables in an IIS 7 application? for details.

December 14, 2011

Runtime Flow v1.3.2 released

Filed under: Uncategorized — Sergey Vlasov @ 4:43 pm

Runtime Flow v1.3.2 released: fixed compound exceptions handling.

Download links: Visual Studio edition, Portable edition.

September 11, 2011

Runtime Flow v1.3.1 released

Filed under: Uncategorized — Sergey Vlasov @ 12:06 pm

Runtime Flow v1.3.1 released – added a .NET 4.0 portable edition executable with deeper call stack support, enabled Options during monitoring.

Download links: Visual Studio edition, Portable edition.

Call stack depth limits

Filed under: Uncategorized — Sergey Vlasov @ 10:47 am

When viewing deep function calls in the Runtime Flow window you may hit a WPF layout recursion limit. To illustrate this problem I created a very simple application:

    class Program
    {
        static void Main(string[] args)
        {
            f(1);
        }

        static void f(int i)
        {
            if (i < 500)
                f(i + 1);
        }
    }

In Runtime Flow portable you can open maximum 58 recursive calls:

Maximum supported stack depth in Runtime Flow .NET 3.5

Maximum supported stack depth in Runtime Flow .NET 3.5


If you try to see more calls you get the following error:
Layout recursion limit reached WPF error

Layout recursion limit reached WPF error

The same problem exists when you view monitoring results in Visual Studio 2008/2005. In .NET 4.0 the layout recursion limit is increased from 255 to 4096. So in Visual Studio 2010 you can view much deeper stacks (though not 1024 deep due to other limitations).

I’ve created an additional Runtime Flow portable binary built for .NET 4.0 to enable more deep stack investigations:

Runtime Flow portable binaries for .NET 3.5 and .NET 4.0

Runtime Flow portable binaries for .NET 3.5 and .NET 4.0

If you have .NET 4.0 installed on the machine, it is now recommended to use RuntimeFlowPortable.NET40.exe instead of RuntimeFlowPortable.NET35.exe. It supports stacks up to 285 function calls:

Maximum supported stack depth in Runtime Flow .NET 4.0

Maximum supported stack depth in Runtime Flow .NET 4.0

Download link: Runtime Flow portable edition v1.3.1.

September 7, 2011

Pause and resume monitoring

Filed under: Uncategorized — Sergey Vlasov @ 4:09 pm

I’ve added the ability to pause and resume monitoring. After you’ve started monitoring (with Run or Customized Run) and have executed a use case, you can press the Pause button on the Runtime Flow toolbar:

The Pause button on the Runtime Flow toolbar

The Pause button on the Runtime Flow toolbar

Pause stops all updates to the Runtime Flow and Runtime Summary windows and eliminates most of monitoring overhead (speeding up the monitored application and limiting memory consumption). In this mode you can browse collected events and execute tasks in your application not required monitoring.

When you are ready to run a next use case, press the Resume button:

The Resume button on the Runtime Flow toolbar

The Resume button on the Runtime Flow toolbar

Resume clears the Runtime Flow and Runtime Summary windows and resumes normal monitoring events processing.

The most common case to not collect monitoring data is to skip application startup. For convenience, I’ve added the Monitor application startup option:

Monitor application startup option

Monitor application startup option

With Monitor application startup unchecked, no flow data is collected until you click the Resume button. This is useful when monitoring complex apps with very big initialization routines that you are not interested in.

Download links for Runtime Flow v1.3.0: Visual Studio edition, Portable edition.

April 29, 2011

New host

Filed under: Uncategorized — Sergey Vlasov @ 2:04 pm

Runtime Flow home page is now a part of Sergey Vlasov Studio website. This blog address was changed, Runtime Flow binaries were updated.

February 22, 2011

Runtime Flow v1.2.6 released

Filed under: Uncategorized — Sergey Vlasov @ 4:46 am

Runtime Flow v1.2.6 released – fixed inability to start monitoring for projects with the trailing slash at the end of the working directory path.

Download links: Visual Studio edition, Portable edition.

« Newer PostsOlder Posts »

Create a free website or blog at WordPress.com.