Troubleshooting Guide: Error 1471 – Database Mirroring Connection Terminated (Out of Memory)
Why This Error Happens
Error 1471 occurs when SQL Server’s internal memory allocator fails to reserve sufficient buffer space to send a message across the database mirroring endpoint, typically due to memory pressure from the max server memory setting being configured too restrictively relative to workload demands. This can also happen when the Database Mirroring transport buffer pool is exhausted because of high-latency network links causing message backlog, or when external memory pressure (such as another SQL Server instance or application) is starving the Windows Server 2025 host of available physical RAM. In some cases, fragmented virtual address space (VAS) on the server—especially in 32-bit legacy configurations or heavily extended instances—prevents contiguous memory allocation even when total free memory appears adequate.
Step-by-Step Resolution Guide
Step 1: Verify and Adjust SQL Server Memory Configuration
- Open SSMS and run
EXEC sp_configure 'max server memory'to check the current ceiling. - Ensure
max server memoryleaves at least 2-4 GB of headroom for the OS on Windows Server 2025, especially if other services share the box. - Example fix:
EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'max server memory', 16384; RECONFIGURE; - Restart the SQL Server service via
services.mscornet stop MSSQLSERVER && net start MSSQLSERVERfor the change to take full effect.
Step 2: Check for Memory Pressure and VAS Fragmentation
- Open Performance Monitor (
perfmon.exe) and add counters forSQLServer:Memory Manager\Memory Grants PendingandSQLServer:Memory Manager\Total Server Memory (KB). - Check the SQL Server Error Log (via
xp_readerrorlog) for prior “RESOURCE_MEMPHYSICAL” or “Failed Virtual Allocate Bytes” warnings that often precede Error 1471. - If running on physical hardware, confirm Windows Server 2025 isn’t reserving excessive memory for Hyper-V or other virtualized workloads sharing the host.
Step 3: Inspect and Tune the Mirroring Endpoint
- Run
SELECT * FROM sys.database_mirroring_endpoints;to confirm the endpoint state isSTARTEDand not stuck in a retry loop consuming buffer memory. - Check the
ENCRYPTIONalgorithm setting on the endpoint (AES is recommended over RC4) since mismatched or outdated encryption can cause excessive message buffering. - If the partner server is on a high-latency WAN link, consider switching the mirroring safety level to
OFF(asynchronous) temporarily to reduce message queue buildup:ALTER DATABASE [YourDB] SET PARTNER SAFETY OFF;
Step 4: Apply Latest Cumulative Update
- Navigate to the Microsoft Update Catalog and confirm you are running the latest Cumulative Update (CU) for SQL Server 2025, as memory allocator fixes for mirroring endpoints are frequently patched.
- Verify your current build with
SELECT @@VERSION;and cross-reference against Microsoft’s build version page before and after patching.
Alternative or Verification Steps
- After applying changes, monitor the SQL Server Error Log and Windows Event Viewer (Application log) for 24-48 hours to confirm Error 1471 does not recur during peak mirroring traffic.
- If the issue persists, consider migrating from Database Mirroring to Always On Availability Groups, as mirroring is a deprecated feature and AGs have more robust memory management for synchronization traffic.