Use Handles when a file cannot be renamed/deleted because something has it open, when a process appears to leak resources, or when you need to identify which process has a specific object open.
Handles
A handle is a value a process uses to refer to an object managed by Windows, such as a file, registry key, event, mutex, process, thread, token or section. The handle is meaningful in the context of the process handle table and carries granted access rights.
1. Handle count: Get-Process -Id <pid> | Select Handles.
2. Growing over time → leak.
3. Which handles: handle.exe -p <pid> (Sysinternals).
4. File locked → handle.exe <filename>.
5. Restart the leaking app; report the leak.
process opens objects (files, keys, events) → handles in its table → closed when done
Check access/share semantics and reproduce whether releasing/closing the owning operation changes the symptom.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Do not close arbitrary handles in a production process just because a tool allows it; the application may depend on that object and can crash or corrupt its internal state. Prefer identifying the owner and correcting the application/workflow or using a controlled restart.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
For a locked file, search for the file path/object in Process Explorer and confirm the process instance. For a suspected leak, record handle count over a representative interval and inspect which object type grows. Correlate growth with a repeatable operation before assigning causation.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- A handle value is process-relative; the same numeric value in another process can refer to a different object.
- Open handles keep references to objects until they are closed/released.
- Handles have access rights, so having a handle does not imply unrestricted access.
- Some handles can be inherited by child processes when both creation and inheritance settings allow it.
- A steadily increasing handle count can indicate a leak, but the object types and workload must be checked.
Get-Process | Sort CPU -Desc | Select -First 10 Name,Id,CPU,WS— top processesGet-CimInstance Win32_Process -Filter "ProcessId=<pid>" | Select Name,ParentProcessId,CommandLine— command line and parenttasklist /v— processes with user and statustaskkill /PID <pid> /T— stop a process tree
ReferenceWhat it is1 section · depth on demand
Core model
Windows exposes many kernel-managed objects through handles. Applications obtain handles when they open/create objects and should close them when no longer needed. Because handles are part of the process runtime context, abrupt termination generally releases them when the process is torn down, but that is recovery rather than root-cause analysis.
ReferenceImportant terms & boundaries2 sections · depth on demand
Runtime / control boundary
Handle inheritance is controlled; a child does not simply inherit every resource of the parent. An inherited handle references the same underlying object, which is why redirected standard input/output, pipes and other interprocess patterns can depend on inheritance. The process tree alone does not tell you which handles were inherited.
In depth
A handle is a process's reference to a kernel object (file, registry key, event, mutex, process, thread, section). Leaks (handle counts growing without bound) eventually exhaust memory or limits.
Get-Process | Sort Handles -Desc | Select -First 10 Name,Id,Handles
handle.exe -p 1234 -s # Sysinternals: summary by type
handle.exe C:\Data\locked.xlsx # who holds a file open
A process with 100 000+ handles is suspicious. Files that cannot be deleted ("in use") are found with handle.exe or Resource Monitor → CPU → Associated Handles.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Processes → Handles. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows/win32/procthread/process-and-thread-functions · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Processes → Handles reference map
Fast lookup boundaries for Processes → Handles.
| Item | Meaning | Evidence boundary |
|---|---|---|
| Handle value | Process-local reference | interpret only with owning PID |
| Object type | File/process/thread/event/etc. | narrows what resource is referenced |
| Object name | Named path/object when exposed | links runtime reference to resource |
| Granted access | Rights on the handle | what operations this reference allows |
| Handle count | Aggregate process metric | trend/object mix needed before calling it a leak |