Thursday, October 4, 2012

Memory leaks in SharePoint 2013?

I believe yes, there are. As this is the preview version there are possibilities for the memory leaks and other development issues. In the SharePoint 2013 server go to task manager and see what is taking more memory. You should see something like below.

Memory_Leaks_In_SharePoint_2013_Preview

We see the Name of the component which is taking huge memory is "Microsoft Office 2013 component". Yes, this is the reason for memory leaks. When you switched to process view you will find out what is that process. It is noderunner.exe.

image
As far as I know this is related to the search service process with new name. Even though our farm is new with very less data the noderunner processes are running and taking huge amount of memory. After good amount of research and read I have found the fix in the technet article here.
 
Make sure you are ready to implement this solution in your environment. Because I found there are some performance issues and exceptions recorded in logs and event viewers after I used the below solution. If we restrict the memory then there are some jobs which are failing in the SharePoint to give correct results and many out of memory exceptions. I was facing issues in below scenarios:
  • Tagging on my site – While I am tagging like #sp2013 it was giving me the error message "The tagging service is currently unavailable. Please try again later."
  • And the bunch of exceptions in the logs and event viewer with below information.
Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (e7f9e006-ec22-476c-9846-5404208b64ce).
Reason: Unable to connect to primary system manager
Technical Support Details:
Microsoft.Office.Server.Search.Administration.Topology.SearchTopologyActivationException: Unable to connect to primary system manager
   at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.Synchronize()
   at Microsoft.Office.Server.Administration.ApplicationServerJob.ProvisionLocalSharedServiceInstances(Boolean isAdministrationServiceJob)
So, I strongly recommend you should not change the value until unless you really having heavier performance issues due to huge memory allocation for noderunner process.
Solution:
  • We can reduce the performance level of the search service by using the below powershell command.
    Set-SPEnterpriseSearchService -PerformanceLevel Reduced

  • Open the file from the location C:\Program Files\Microsoft Office Servers\15.0\Search\Runtime\1.0\noderunner.exe.config and find the line <noderunnersettings tag. We must set the attribute memoryLimitMegabytes value from 0 to some value which you should like to give. I strong recommend to give at least 1024, so that it will not grow too much beyond that. The tag should look like below.
    <nodeRunnerSettings memoryLimitMegabytes="1024" />
Note: This fix is needed only for SharePoint 2013 preview edition as the actual version should fix this issue.

4 comments:

  1. Tnx M8 for help i was wondering what should i do with that much memory use.

    ReplyDelete
  2. I set 10Gb of RAM at my test VM, installed December 2013 CU, set 500mb as the limit for nodeRunner and got about 50% of memory taken by all apps. But this crap throws outOfMemoryException every 20 seconds in event log :(

    ReplyDelete
  3. After i do this work, My search don't work.but Memory reduce.

    ReplyDelete
  4. Same here amir. I don't even imagine the mess it could be if more than 5 users do a search at almost the same time. I have to find something, I'm not going to deal with this issue a long time.

    ReplyDelete