“Memory usage exceeded” – Server running out of memory, causing slowdowns or crashes.

Loading

Troubleshooting “Memory Usage Exceeded” in SharePoint

When a SharePoint server runs out of memory, it can lead to performance slowdowns, application pool crashes, and even system instability. High memory usage is typically caused by heavy SQL queries, excessive background services, memory leaks, large caching, or inefficient web parts. Below is a detailed step-by-step guide to diagnose and resolve high memory usage in SharePoint.


1. Identify the Cause of High Memory Usage

Before applying fixes, determine which process is consuming excessive memory.

Tools for Diagnosis

Task Manager (taskmgr.exe) → Identify high memory-consuming processes.
Resource Monitor (resmon.exe) → Analyze detailed memory usage.
Performance Monitor (perfmon.msc) → Track memory consumption over time.
SharePoint Health Analyzer → Check for memory-related warnings.
SQL Server Profiler → Monitor long-running or resource-intensive queries.
Fiddler/Wireshark → Analyze excessive network data transfers impacting RAM.


2. Optimize SharePoint Application Pool Usage

Each IIS Application Pool uses memory, and an overloaded pool can cause excessive RAM consumption.

Fixes

🔹 Open IIS Manager (inetmgr)Application Pools.
🔹 Recycle application pools periodically to free memory.
🔹 Reduce the number of web applications running in separate pools.
🔹 Use Web Garden settings to distribute load across CPU cores.
🔹 Increase Idle Time-out for unused app pools.


3. Optimize SQL Server Memory Usage

Since SharePoint heavily relies on SQL Server, excessive memory allocation to SQL can cause system slowdowns.

Fixes

🔹 Set a maximum memory limit for SQL Server:

  1. Open SQL Server Management Studio (SSMS).
  2. Run the following command to check the current memory limit: EXEC sp_configure 'max server memory'
  3. Adjust the memory limit (e.g., allocate 75% of total RAM to SQL Server): EXEC sp_configure 'max server memory', 12288; -- Set to 12GB (adjust as needed) RECONFIGURE;

🔹 Optimize database performance:

  • Rebuild indexes (ALTER INDEX ALL ON [TableName] REBUILD;).
  • Reduce autogrowth settings (set fixed growth size instead of percentage).
  • Clean up unused data from logs and temp tables.

4. Reduce SharePoint Caching Overhead

Caching helps improve performance, but excessive caching can lead to high memory usage.

Fixes

🔹 Adjust Object Cache Size in Central Administration:

  • Go to Manage Web ApplicationsResource Throttling.
  • Reduce Object Cache Size (default is 100MB, lower to 50MB if needed).
    🔹 Reduce BLOB Cache Size in web.config:
<BlobCache location="C:\BlobCache" path=".*\.(gif|jpg|png|css|js|ico)$" maxSize="5" enabled="true" />

🔹 Clear existing caches periodically.


5. Identify and Fix Memory Leaks in SharePoint Services

Some SharePoint services consume excessive memory over time, leading to memory leaks.

Fixes

🔹 Open Task Manager → Identify memory-heavy processes (e.g., OWSTIMER.EXE, SPSEARCHHOSTCONTROLLER.EXE).
🔹 Restart unnecessary services:

  • Disable unused services in Central Administration.
  • Restart SharePoint Timer Service (services.msc).
    🔹 Run PowerShell cleanup scripts to free memory:
Restart-Service SPTimerV4
iisreset /noforce

🔹 Monitor w3wp.exe (IIS Worker Process) for high RAM usage.


6. Optimize Large Lists and Workflows

Large lists and heavy workflows consume excessive RAM during queries.

Fixes

🔹 Enable List View Threshold limits (Central Admin → Manage Web Applications → Resource Throttling).
🔹 Index large lists to improve query efficiency.
🔹 Archive old workflows and data to reduce memory footprint.
🔹 Use Power Automate instead of SharePoint Designer workflows.


7. Check and Adjust Paging File (Virtual Memory)

If physical RAM is insufficient, Windows uses virtual memory (page file), but improper settings can cause performance degradation.

Fixes

🔹 Open System Properties (sysdm.cpl)AdvancedPerformance Settings.
🔹 Increase the paging file size to 1.5x RAM size (e.g., 16GB RAM → 24GB page file).
🔹 Move the paging file to a separate drive for better performance.


8. Regular Maintenance and Monitoring

8.1. Automate Memory Monitoring

✅ Set up Performance Monitor Alerts for high memory usage.
✅ Use SharePoint Health Analyzer to detect memory-related issues.
✅ Configure Event Viewer Alerts for memory-related logs.

8.2. Keep SharePoint and SQL Server Updated

✅ Install the latest SharePoint Cumulative Updates (CUs) to fix memory leaks.
✅ Regularly patch SQL Server and Windows Server.


Leave a Reply

Your email address will not be published. Required fields are marked *