0X0000274B

Fixing WSAETOOMANYREFS (0x0000274B) on Windows Server

Network & Connectivity Intermediate 👁 5 views 📅 Jul 13, 2026

This error means Windows ran out of kernel object references, usually from too many open sockets or handles. The quick fix is closing unused apps or rebooting, but the real fix is adjusting the TCP/IP parameter.

Quick answer: Reboot the machine to clear stuck handles, then check for handle leaks using !htrace in WinDbg. If that doesn't cut it, increase the kernel object limit via registry.

What's actually happening here

You're seeing 0x0000274B (WSAETOOMANYREFS) when your app tries to create a socket or bind to a port. This isn't a port exhaustion issue — it's a kernel object reference counter hitting its cap. Windows keeps a count of open references to certain kernel objects like sockets, file handles, or threads. When that count hits 16,384 (the default limit), Windows says "no more."

I've seen this most often on Exchange servers running 2016 or 2019, especially after a backup job goes sideways and leaves orphaned connections. Also happens on IIS servers with high concurrent user loads where the app pool doesn't recycle cleanly.

Fix steps (try in order)

  1. Reboot the server. Yeah, boring, but it works. If the error goes away after reboot, you've got a leak somewhere. Start tracking down the culprit.
  2. Check handle counts. Open Task Manager, go to the "Details" tab, add the "Handles" column. Sort descending. Look for any process with more than 5000 handles. That's your leak.
  3. Use netsh to check TCP settings. Run this command in an elevated command prompt:
    netsh int tcp show global
    Look for "TCP Chimney Offload" — if it's enabled, disable it. That feature causes more problems than it solves.
    netsh int tcp set global chimney=disabled
  4. Increase the kernel object limit. This is the real fix for servers that legitimately need more references. Open regedit, go to:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
    Create a DWORD called TcpMaxDataRetransmissions with a value of 10 (decimal). Then create another DWORD MaxUserPort with a value of 65534 (decimal). Reboot after changing these.
  5. Check for handle leaks in code. If you control the application, use WinDbg or Process Monitor to trace handle creation and closure. Look for CreateFile or WSASocket calls without matching CloseHandle or closesocket.

Alternative fixes if the main ones fail

If you've rebooted, checked handles, and still see the error:

  • Disable Windows Filtering Platform (WFP). Third-party firewalls or antivirus can peg the reference counter. Temporarily disable the service (it's BFE in services.msc) and see if the error stops. If yes, blame your security vendor.
  • Increase the IRPStackSize registry value. Go to HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters and set IRPStackSize to 20 (decimal). This allocates more buffer space for I/O request packets.
  • Check for port exhaustion anyway. Even though the error isn't about ports, sometimes it masks itself. Run:
    netstat -an | find ":80" | find "TIME_WAIT"
    If you see thousands of TIME_WAIT connections, reduce the TcpTimedWaitDelay from 240 to 30 seconds via registry.

Prevention tips

  • Monitor handle counts daily. Set up a perfmon counter for Process\Handle Count per process. Alert if any process goes over 3000 handles.
  • Use connection pooling in your apps. Don't open/close sockets per request. That's amateur hour.
  • Keep Windows updated. Several patches between 2020 and 2023 fixed kernel object reference bugs. At minimum, be on Windows Server 2019 with KB5005112 or later.
  • Set a scheduled task to restart leaky services. If you can't fix the code, restart the service nightly at 3 AM. Not elegant, but it works.

Bottom line: 0x0000274B is your system saying "I'm full." Listen to it. Reboot first, then dig into handle counts. The registry tweaks above have saved my ass dozens of times on Exchange and IIS boxes.

Was this solution helpful?