Skip to content
0x0000013AKERNEL_MODE_HEAP_CORRUPTIONStop codeWidely reported

KERNEL_MODE_HEAP_CORRUPTION (0x13A): what it means and how to fix it

Updated Nov 6, 2026 · Checked against Microsoft documentation · How this page is made

Quick answer

Stop code 0x0000013A indicates that the Windows kernel-mode heap manager detected corruption in system memory. A device driver or kernel service typically triggered this by writing beyond its memory boundaries or mismanaging memory allocations. Check Device Manager and Event Viewer to identify and update any failing drivers.

What it means

Windows reserves a shared pool of memory called the kernel-mode heap for core operating system routines and device drivers. When system software needs temporary memory to process tasks, it requests a block from the heap manager and returns that block when the operation finishes. The kernel-mode heap manager constantly tracks these blocks to ensure drivers stay within their designated memory spaces.

A stop code 0x13A occurs when the heap manager detects that an internal heap structure has been corrupted. The operating system provides four parameters to describe the crash. Parameter 1 defines the exact corruption type detected. Parameter 2 records the address of the heap reporting the issue, Parameter 3 gives the address where the corruption occurred, and Parameter 4 is reserved.

Several specific programming errors trigger this crash. A buffer overrun (corruption type 0x6) happens when a driver writes data past the boundary of its allocation, damaging adjacent data. A buffer underrun (type 0x7) occurs when data is written before the beginning of the block. Use-after-free errors (types 0xB, 0xD, 0x12, and 0x17) occur when a driver attempts to read or modify a memory block after returning it to the system. Double-free errors (type 0x11) and illegal actions on free memory (type 0xF) occur when software attempts to release an allocation that was already cleared. The heap manager also halts if it encounters NULL heap handles (type 0x13), corrupt entry headers (types 0x3, 0x4, and 0x5), or requests that exceed current commit and allocation limits (types 0x14 and 0x15).

Why Windows stops execution

Halting the system protects your data. When memory structures become corrupted, allowing the system to continue running risks writing damaged data to your storage drives or crashing other critical services. Windows halts immediately to prevent broader corruption. Technicians inspect these crashes using debugger tools such as WinDbg, running the !analyze command to pinpoint the failing module and !heap to inspect heap usage.

Common causes

  • A device driver wrote data beyond its allocated memory boundary, causing a buffer overrun or underrun.
  • Kernel software accessed or modified a memory block after it had already been freed (use-after-free).
  • A driver attempted to release the same memory allocation twice (double-free) or ran an illegal operation on a free block.
  • An invalid argument or a NULL heap handle was passed into the heap management API.
  • A memory request exceeded the current system allocation or commit limit.
  • A recently installed driver, hardware component, or system service introduced memory structure conflicts.

How to fix it

Safest and most likely fixes first. Readers' answers to "Did this fix it?" reorder this list over time.

  1. Check Device Manager for problem drivers

    Use this first to see if Windows has identified a failing or misconfigured hardware device.

    1. Right-click the Start menu button and select Device Manager.
    2. Scan the device categories for any item displaying a yellow exclamation point.
    3. Right-click any flagged device and select Properties.
    4. Select the Events tab to check for reported device or driver errors.
    5. Open the Driver tab and select Update Driver, or choose Roll Back Driver if the issue started following a recent driver update.
    Did this fix it?
  2. Inspect the System log in Event Viewer

    Use this to identify which driver file or system service produced errors at the moment of the crash.

    1. Right-click the Start button and select Event Viewer.
    2. Expand Windows Logs in the left pane and click System.
    3. Locate Critical and Error entries that have timestamps matching the time of your blue screen.
    4. Read the event descriptions to see if a specific driver file, system service, or hardware device is named.
    5. Update, roll back, or remove the driver or service identified in the log entry.
    Did this fix it?
  3. Remove or update recently added hardware and software

    Use this if the stop code began appearing shortly after you connected new hardware or updated system services.

    1. Disconnect any recently attached external or internal hardware devices.
    2. Check the hardware manufacturer's support site to determine if updated firmware or system patches exist.
    3. Uninstall any recently installed system services or driver packages.
    4. Restart the computer to verify whether the error clears.
    Did this fix it?
  4. Scan for malware and boot sector infections

    Use this if the crash occurs without hardware changes, as virus-related disk corruption can generate bug checks.

    1. Open your virus detection program.
    2. Check for and install the latest security intelligence updates.
    3. Run a full system scan, making sure the scan includes the Master Boot Record.
    4. Quarantine or remove any threats detected by the scan, then reboot the system.
    Did this fix it?
  5. Run Driver Verifier to isolate misbehaving drivers

    Use this built-in diagnostic tool only if standard logs do not pinpoint the responsible driver, as it adds performance overhead.

    1. Type cmd in the Windows search bar, right-click Command Prompt, and select Run as administrator.
    2. Type verifier and press Enter to launch Driver Verifier Manager.
    3. Choose to create custom settings and select the pool options to inspect memory resource usage.
    4. Select a small group of suspect third-party drivers to test rather than verifying all drivers at once.
    5. Restart the PC and monitor the system; if a crash occurs, note the driver name displayed on the screen.
    6. Open Command Prompt as an administrator and run verifier /reset to disable the tool after testing.
    Did this fix it?

Is it just you?

25+ Microsoft Q&A threads discuss this. Most recent activity:

Checked Nov 4, 2026. Refreshed automatically every few days.

Sources

Frequently asked questions

What does KERNEL_MODE_HEAP_CORRUPTION mean?

It means the Windows kernel-mode heap manager detected damage inside a memory heap. This occurs when a kernel driver or service writes beyond its allowed boundary, uses memory after releasing it, or sends invalid commands.

Can a graphics driver cause stop code 0x13A?

Yes. Graphics drivers interact closely with kernel memory management, and coding errors like buffer overflows or passing invalid data can corrupt the kernel heap.

How do technicians find the exact cause of error 0x0000013A?

Technicians open the memory dump file in a debugger such as WinDbg. They run the `!analyze` extension to inspect the crash stack and use the `!heap` extension to examine memory allocation details.

Does 0x13A mean my RAM is broken?

Not usually. While failing hardware can occasionally cause random memory issues, this bug check is almost always caused by a software bug in a driver, such as a buffer overrun or a use-after-free error.