Process monitor to fix registry glitches

Background:

Recently we found this error message too frequent from one of our SharePoint server.

Windows SharePoint Services General 8l1n High An SPRequest object was reclaimed by the garbage collector instead of being explicitly freed. To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it. Allocation Id: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} To determine where this object was allocated, create a registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings. Then create a new DWORD named SPRequestStackTrace with the value 1 under this key. 

I read this wonderful blog on this:

https://blogs.technet.com/stefan_gossner/archive/2008/05/07/troubleshooting-spsite-spweb-leaks-in-wss-v3-and-moss-2007.aspx

Although the error message was pretty self-explanatory. So, as recommended I went inside my server registry and created a new key “HeapSettings’, it was not present by default. Under “HeapSettings” I created another key names SPRequestStackTrace with DWORD value as 1.

Then I restarted my SharePoint service. But  my surprise I found the same message on the SharePoint logs. Somehow the SharePoint service disregarded this new registry key. I thought of taking help of Process Monitor (https://technet.microsoft.com/en-us/sysinternals/bb896645.aspx)from Sysinternals, and followed these steps:

  1. Stop the SharePoint service
  2. Start Process monitor and select only the registry events.
  3. Set a filter for OWSTIMER.EXE process and registrypath HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings
  4. Start the Service.

 Observation:

I found this screenshot below. For some reasons the service can’t read this key as it says “NAME NOT FOUND”.

image

I thought it might be an issue with the key permission. But it was fine.

Later on casually I copied the string SPRequestStackTrace into  notepad to see the presence of any non printable character, and I found there is a space at the end “SPRequestStackTrace<SPACE> “ like this.

Recheck:

I made the necessary changes in the registry key name and followed the same four steps and found this. It was absolute fine.

image

I started loving this wonderful tool process monitor.

del.icio.us Tags: process monitor,SPRequestStackTrace,SharePoint,trailing space registry key name