We all know that. NET has its own memory (garbage) recovery mechanism, unless there is some data (methods) of long-term possession of memory does not follow the garbage collection function to free memory, so that we often say that the memory leaks, memory growth is not released and other issues caused by aps.net website or c/ The user of the S application is not working properly. The end result will be the user through the customer service personnel or technical support staff to complain about the company's technical department, a series of unknown adverse reactions.
No matter who the performance tester, encounter such a problem is puzzled, do not know where to start. The. NET environment does not have as many tools as Java, such as Jconsole, Jprofiler and other tools that are often used in performance testing. And based on the Java Runtime Environment, it is also very powerful in printing GC logs. For the. NET platform, Microsoft also provides the. NET helper CLR Profiler to help our performance testers and developers find that memory is not being reclaimed in a timely manner, and that the memory does not release the method (detailed to the array or other variable defined below this method).
: Http://search.microsoft.com/en-us/DownloadResults.aspx?q=clr%20profiler
Can be based on their own computer. NET version to download the corresponding CLR Profiler, I downloaded the CLR Profiler for. NET Framework version 4.
After downloading the prompt decompression, select the directory to be pressurized to, and then enter the D:\SoftWare\CLRProfiler4\CLRProfiler\Binaries directory to select the corresponding operating system 64-bit or 32-bit CLRProfiler.exe.
In a word, clrprofiler can analyze almost all of the products developed by the. NET platform, including C/s applications, services, and Web sites written by ASP.
My environment is: IIS Server (ASP. NET developed site) +ms SQL
Open the Clrprofiler interface, check profiling active, allocation, and calls, "Start Application" is the EXE program that loads. NET development; "Start URL" is the URL of the page being tested;
I want to test the ASP. NET Development page in IE, the CLR Profiler first loads the environment variables required by IIS, and the CLR Profiler then prompts you to load the ASP. NET application and wait for the ASP process to start.
In the File menu, click Profile ASP.
Stopping the IIS service can take a long time, and you need to wait patiently. The last hint is to test the page.
"Waiting for ASP. NET to start common language runtime-this are thetime to load your test page"
Click the "Start url" button, enter the URL of the page we want to test, click OK, it will automatically open we want to check the memory has not freed the memory of the page, more in the page for a while, so that the CLR Profiler to collect more data.
When you have finished running the page, click Kill asp in the CLR Profiler window. The CLR profiler then automatically shuts down IIS, removes environment variables, and restarts IIS.
Click on "Allocation Graph" to open the memory allocation view, in which we can see how the stack is separate objects
Clicking on the "Objects by Address" button will show the various methods in memory occupied by the Histogram interface
You can right-click Show who allocated by selecting one of the bar bars in that view. Click this menu item to display specific details about the selected assignment, rather than all assigned
Click [TimeLine] button, in the open image can clearly see the recovery time and front and rear memory consumption situation
In the View menu, there are many menus that are not displayed.
By clicking on the Call Tree menu, you can see information such as memory size, number of calls, etc. for all methods under different threads
. NET Program Memory analysis tool Clrprofiler use (performance test)