Troubleshooting Guide: Error 373 – GDI Handle Leak on Windows 11
Why This Error Happens
Error 373 occurs when an application creates GDI objects (pens, brushes, device contexts, bitmaps) but fails to release them properly using functions like DeleteObject() or ReleaseDC(). Each process on Windows is limited to 10,000 GDI handles by default, and a poorly coded application that continuously allocates new handles without freeing old ones will eventually exhaust this quota, triggering the leak warning in Event Viewer. This is typically a symptom of a bug in the application’s rendering or UI update loop rather than a Windows configuration problem.
Step-by-Step Resolution Guide
- Identify the offending process using Task Manager:
- Right-click the taskbar → Task Manager → Details tab.
- Right-click the column header → Select columns → check GDI objects.
- Sort by this column and watch which process’s count climbs continuously over a few minutes.
- Check Event Viewer for details on the specific application:
- Open
eventvwr.msc→ Windows Logs → Application. - Locate Event ID 373, note the source application name, PID, and timestamp to correlate with the Task Manager data.
- Update or patch the application:
- Check the vendor’s website or Windows Update for a newer build, since GDI leaks are almost always fixed via code patches, not registry tweaks.
- If it’s a Microsoft component, run
sfc /scannowandDISM /Online /Cleanup-Image /RestoreHealthfrom an elevated Command Prompt to repair corrupted system files that may be causing abnormal rendering behavior.
- Increase the GDI handle quota (temporary workaround):
- Open
regeditand navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows - Add/modify a DWORD value named
GDIProcessHandleQuotaand set it to a higher value (e.g.,20000, max65536in decimal). - Restart the affected application (a full reboot may be required for the change to take effect).
- Isolate third-party interference:
- Perform a Clean Boot (
msconfig→ Services tab → check Hide all Microsoft services → Disable all) to rule out conflicting background apps or overlays (e.g., RGB software, screen recorders) that hook into GDI calls.
Alternative or Verification Steps
- Verify the fix: Reopen the application, monitor the GDI objects column in Task Manager for 15–20 minutes of normal usage — it should stabilize rather than continuously increase.
- Alternative: If the app is unsupported or can’t be patched, run it in a sandboxed environment (Windows Sandbox) or restart the process periodically via Task Scheduler to prevent it from hitting the handle ceiling and crashing.