Using Intel Inspector XE 2011 on a Microsoft* Windows* Service


The most common usage model for Intel® Inspector XE is to have it launch the executable to collect data - but analysis of a Windows* service is also supported.  This article describes the steps to memory check or thread check a Windows service using Inspector XE.


The following is a step by step method for running the command line version of Inspector XE on a Windows service. (These steps assume a service named "YourService").

Note: In these steps you will be modifying the Windows Registry.  Before taking these steps, you should consider creating a backup of the registry. See for details.

1.     At the Start-> Run prompt, type  "regedit"

2.     Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\YourService", modify the "ImagePath" registry value:

•         Add <Full Path to Inspector XE>/install/bin32/inspxe-cl -collect mi3 -r C:\result_dir\myRes -- <Original Image Path setting>.  This will modify how the service is started, so that it will be launched by Inspector XE.

•         The step above will start memory checking level 3, e.g., 'mi3', on the Windows service.  To learn how to change the analysis type or level, see the "Command-line Interface Support" section of the user's guide at /sites/products/documentation/hpc/inspectorxe/en-us/2011Update/win/ug_docs/index.htm

•         Results of the analysis will be stored in C:\result_dir.

3.     At the Start ->Control Panel->System and Security>Administrative Tools->Services dialog, right click on "YourService" and select "restart".

4.     You are now running an Inspector analysis on a Windows service. Data will be collected until you stop the service in step 5.

5.     To get a complete analysis report, return to Administrative tools-> Services, right click on "YourService" and press "stop".

6.     You should be able to see the created report by double clicking on the file C:\result_dir\myRes.inspxe to open the report in the Inspector XE graphical interface.

7.     To restore the original service behavior, restore the "ImagePath" setting that you replaced in step 2.


It is possible that running your service under Inspector XE will slow down the service startup so much that the default time interval for service startup will be insufficient.  If the service fails to start, you may need to increase the timeout interval by following these steps:

1.     At the Start-> Run prompt, type "regedit"

2.     Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet", select  "New" and click on DWORD Value.

3.     Type ServicesPipeTimeout, replacing "New Value #1"

4.     Right click ServicesPipeTimeout and click Modify.

5.     In the Value data box, type the number of milliseconds for the new timeout period. (30,000 is the default, equivalent to 30 seconds)

6.     You will need to restart your computer to apply these changes.

7.     To restore the original time out setting, right click on the ServicesPipeTImeout that you modified in step 5. In the Value data box type 30,000. (the default timeout) . Again, you will need to restart your computer to apply these changes.


Additional Information

For additional information on how to debug a Windows* service, see

Para obter informações mais completas sobre otimizações do compilador, consulte nosso aviso de otimização.