Profiling SharePoint
Published 14 December 2012
ANTS Memory Profiler can profile managed code that runs on a Microsoft SharePoint 2007 or 2010 server.
ANTS Memory Profiler 7.3 and later
To profile SharePoint:
- Start ANTS Memory Profiler. If it's already running, on the File menu, click New Profiling Session.
- Under Choose application type to profile, selectSharePoint web application (IIS).
- Click to load a list of SharePoint sites that are currently running into the dropdown.
- Choose the site that you want to profile.
- Normally, you'll want to keep Profile child processes and Monitor disposal of objects selected, but this can affect your application's performance.
- Choose the port to profile your application on:
- If your application doesn't bind to a specific port, select Unused port and choose a port that is not used by IIS.
- If your application must use the port it currently runs on, select Original port (IIS will restart).
If IIS does not restart correctly, use IIS Manager to stop the website until you have finished profiling.
The port where the application will be profiled is displayed at the bottom of the ANTS Memory Profiler Settings dialog box.
If needed, select Manually specify ASP.NET account details and enter the User name, Password, and Domain.ANTS Memory Profiler profiles your web application as the Windows Local System user. If the Windows Local System user doesn't have the permissions to use your SharePoint site collection, enter the credentials of a user with the required permissions. This user must also be an administrator on the computer ANTS Memory Profiler runs on.
With IIS 5, your web application will always run under the ASPNET account. Make sure that the ASPNET account has permission to read from %ProgramFiles%\Red Gate\ANTS Memory Profiler 7\RedGate.Memory.Core.dll
The Profiling will use URL notice confirms the URL that will be used for profiling, including any unused port you have set.
- If needed, change the performance counters to record.
- Click .
- Check whether there are any memory problems.
ANTS Memory Profiler 7.2 and earlier
ANTS Memory Profiler can profile managed code that runs on a Microsoft SharePoint server because Microsoft SharePoint 2007 is implemented as an ASP .NET web application.
Though ANTS Memory Profiler was not designed to support SharePoint 2010 profiling, a workaround exists that may let you profile managed code running on a SharePoint 2010 server. For details, see Profiling SharePoint 2010.
To profile Sharepoint 2007, follow the procedure for profiling an ASP.NET web application on IIS.
If you encounter difficulties, the most likely cause is that ANTS Memory Profiler cannot read from the directory to which SharePoint is writing data. To fix this:
- Create a temporary directory.
- If you are not on a sensitive system, allow full read/write access to this temporary directory to all users.
If you are on a sensitive system, ensuring that the local system account has read/write access should suffice. - Use Control Panel to add a new environment variable. The variable must be called RGIISTEMP and the value is the path to the temporary directory you just created.
For more information, see Profiling SharePoint with ANTS Performance Profiler 5.2 (Simple Talk).
Troubleshooting
If you experience problems, see Troubleshooting SharePoint profiling.
SharePoint's API is still partly unmanaged; if you have been experiencing memory problems with SharePoint, you might find the following MSDN articles helpful: