What does Windows error code 164 (ERROR_MAX_THRDS_REACHED) mean?

 
Could be also:
ConstantTypeOS
CNSS_FILE_SYSTEM_FILTERBugCheck CodeWindows
Previous Next
ERROR_SIGNAL_PENDING ERROR_LOCK_FAILED

ERROR_MAX_THRDS_REACHED

What ERROR_MAX_THRDS_REACHED means

No additional threads can be created because the applicable thread limit has been reached. This result can represent process address-space exhaustion, runtime limits, subsystem quotas, or an application thread leak. CPU utilization may still be low because the limiting resource is thread metadata or stack reservation.

Common causes

  • Unbounded per-connection thread creation
  • Large reserved stacks exhaust virtual address space
  • A library keeps background threads after clients are closed
  • The process runs inside a constrained job or compatibility subsystem

How to investigate

  1. Record process thread count and virtual-memory layout
  2. Group threads by start address and stack signature
  3. Inspect configured stack size and linker settings
  4. Test whether a bounded worker pool eliminates the failure

Developer guidance

Design backpressure before the limit is reached. Reject or queue excess work, and use asynchronous operations for high fan-out workloads.

Administrator and support guidance

Collect thread and memory diagnostics before restart. Increasing limits without correcting unbounded creation can move the failure to a more damaging resource.

How this code differs from related results

ERROR_TOO_MANY_TCBS is closely related but may be emitted specifically by older thread-control-block management.

Evidence worth collecting

For ERROR_MAX_THRDS_REACHED, begin the trace at the operation where unbounded per-connection thread creation. For ERROR_MAX_THRDS_REACHED, preserve the exact API boundary, numeric result, process and thread identifiers, relevant object state, and the component version. The first verification point should be to record process thread count and virtual-memory layout. This evidence distinguishes the specific ERROR_MAX_THRDS_REACHED contract from a later secondary failure.

Recovery and verification

Recovery for ERROR_MAX_THRDS_REACHED should address the observed condition rather than merely retrying the same call. After the change, reproduce the scenario in which unbounded per-connection thread creation, then confirm that the intended operation completes and that cleanup returns all associated resources. For ERROR_MAX_THRDS_REACHED, also verify that the next repeated operation follows the same successful path without increasing the resource class implicated by this result.

When to escalate

Escalate ERROR_MAX_THRDS_REACHED with a minimal reproduction focused on the failing pipe or compatibility boundary. Include the operating-system build, binary architecture, runtime or compatibility-layer version, the exact input values, and a timestamped trace showing unbounded per-connection thread creation. For the ERROR_MAX_THRDS_REACHED escalation record, note whether changing concurrency, object lifetime, target process, module set, or endpoint location alters the result.

References


Looking for a different code? Search another status or error code.