Windows PC Errors

How to Fix KERNEL_MODE_HEAP_CORRUPTION BSOD (0x0000013A)

Error 0x0000013APlain English: Windows caught corruption inside its own memory manager and hit the emergency stop to protect your files. The fix is usually updating a bad driver, reverting an overclock, or replacing a faulty RAM stick.
Quick answer: 0x0000013A means the kernel found its heap — the memory Windows manages for itself — damaged. Revert the most recent change first, and disable any overclocking or XMP memory profile, since unstable memory is a top trigger. Then update your graphics, chipset, and storage drivers from the manufacturer's site, run Driver Verifier to name a corrupting driver, repair system files with SFC and DISM, scan for rootkits with Defender Offline, and test your RAM with the Windows Memory Diagnostic. Full steps below.

What error 0x0000013A means

The kernel heap is the private memory pool the Windows kernel uses to keep track of everything: driver objects, process records, timers, device states. Windows watches this bookkeeping closely, and if it finds the records damaged — a pointer that no longer points where it should, a block header that has been overwritten — it stops the entire system with KERNEL_MODE_HEAP_CORRUPTION (stop code 0x0000013A) rather than continue running on corrupted internal data. Despite the dramatic name, this is a protective crash, not data loss: Windows is refusing to keep going while it cannot trust its own memory.

In practice there are two dominant causes, and they trade places depending on the machine. The first is a buggy or incompatible driver that writes into memory it doesn't own — graphics drivers are the usual suspects, followed by chipset and antivirus drivers. The second is hardware memory instability: failing RAM sticks, bad disk sectors, or an overclocked memory/CPU/GPU configuration that corrupts kernel data the moment timings slip. This blue screen also shows up after failed Windows updates, corrupted system files, and (less commonly) rootkit infections. The steps below chase the causes in that order: newest change and overclocks first, drivers second, system files and malware third, hardware last.

Common causes

How to fix error 0x0000013A — step by step

Work through these fixes in order. Step 1 fixes the most common scenario in minutes; the later steps cover the stubborn cases.

  1. Undo the most recent change first. This blue screen very often starts right after something changed on the PC: a driver update, a Windows update, new RAM sticks, a new antivirus, or an overclocking change in the BIOS. Think back over the last few days. If you can boot normally, press Win + I, go to Apps > Installed apps, sort by install date, and uninstall anything added just before the crashes began. If you recently installed new memory, reseat the sticks and try them one at a time. A freshly updated graphics or chipset driver and a fresh overclock are the two fastest things to suspect, and undoing them takes minutes — try this before anything else.
  2. Revert any overclocking and run Safe Mode. Overclocked RAM (XMP/EXPO profiles included), an undervolted CPU, or an overclocked GPU are classic triggers of heap corruption, because the kernel's memory bookkeeping is the first thing that breaks under unstable memory timings. Restart, enter the BIOS/UEFI (usually Del or F2), load optimized defaults, and disable XMP/EXPO for now — you can re-enable it after the crashes stop. Then boot into Safe Mode to test stability: interrupt the boot process three times in a row (hold the power button at the Windows logo) to reach Recovery, go to Troubleshoot > Advanced options > Startup Settings > Restart, and press 4 for Safe Mode. Safe Mode loads only Microsoft's drivers, so stability here points at a third-party driver; continued crashes point at hardware.
  3. Update or roll back drivers from the real sources. Press Win + X and open Device Manager. If the crashes began after a driver update, find that device, right-click it, open Properties, go to the Driver tab, and click Roll Back Driver. Otherwise update the big three from your PC or motherboard maker's support page — chipset, graphics, and storage controller — rather than relying on Windows Update's generic versions. Look for any device with a yellow warning triangle while you are there. Graphics drivers are a frequent offender for heap corruption, so grab the latest stable release from NVIDIA, AMD, or Intel directly instead of a beta, and do a clean install if the option is offered.
  4. Run Driver Verifier to catch the corrupting driver — carefully. Heap corruption is almost always caused by a driver writing into memory it doesn't own, and Driver Verifier is Microsoft's tool for forcing the guilty driver to crash loudly and get named in the next dump. First, create a restore point (search "Create a restore point" in the Start menu and click Create). Then press Win + R, type verifier.exe, choose "Create standard settings," and select the drivers you suspect — or "Automatically select all drivers installed on this computer" if you have no suspect. Restart and use the PC normally. Warning: Verifier deliberately stresses drivers, so a bad driver can crash the PC at boot — that is the point. If you get stuck in a crash loop, boot into Safe Mode and run verifier /reset from an admin command prompt to switch it off, then remove or roll back the driver named in the dump. Reset Verifier when you finish; it is a diagnostic tool, not a permanent setting.
  5. Repair Windows system files with SFC and DISM. Corrupted kernel components can look exactly like heap corruption caused by a driver. Open an admin Terminal (right-click Start > Terminal (Admin)). Run sfc /scannow first and let it finish — it checks and repairs protected Windows files. Then run DISM /Online /Cleanup-Image /RestoreHealth, which repairs the component store that SFC depends on. If SFC found corruption it couldn't fix, run SFC once more after DISM finishes. Restart and check whether the crashes stop. These two commands handle the "Windows damaged by a failed update or a hard shutdown" version of this error.
  6. Scan for malware and rootkits. Memory-resident malware and rootkits hook deep into the kernel and leave behind exactly the kind of heap corruption this bug check catches. Run a deep scan with Windows Security (Windows Security > Virus & threat protection > Scan options > Microsoft Defender Offline scan > Scan now) — the offline scan runs before Windows loads, so it can catch malware that hides once the system is running. If you use a third-party antivirus, run its boot-time or full-system scan as well, since the product's own kernel driver is itself a possible suspect if the offline scan is clean.
  7. Test the RAM thoroughly and check the drive. A memory stick with bad cells corrupts the kernel heap the same way a bad driver does. Press Win + R, type mdsched.exe, and choose "Restart now and check for problems." Let it finish — any reported error means a stick needs replacing; if you have two or more sticks, retest them one at a time to find the faulty one. For a deeper test, run MemTest86 from a USB stick overnight if crashes continue despite a clean Windows Memory Diagnostic. Then open an admin Terminal and run chkdsk C: /f /r, type Y, and restart so the scan runs before Windows loads, catching bad sectors that can corrupt kernel data on disk.

Did this fix it? Quick checklist

If crashes continue after all seven steps, the crash dump has the answer. Open C:\Windows\Minidump, note the newest .dmp file, and open it with WinDbg (free from the Microsoft Store) — the "Probably caused by" line usually names the driver directly. Update the BIOS if you haven't yet, and as a last resort back up your files and use Settings > System > Recovery > Reset this PC (choose "Keep my files" first). A fresh Windows that still crashes with 0x0000013A points at hardware — RAM first, drive second, motherboard third.

Frequently asked questions

What causes KERNEL_MODE_HEAP_CORRUPTION (0x0000013A)?

The kernel heap is the memory manager Windows itself uses, and 0x0000013A means the kernel caught that heap's internal records being corrupted. The most common cause is a buggy or incompatible driver writing into memory it doesn't own — graphics, chipset, and antivirus drivers are repeat offenders. Failing RAM, unstable overclocking or XMP memory profiles, corrupted Windows system files, and rootkits can cause the identical crash. Fixes follow that ranking: revert recent changes and overclocks, update or roll back drivers, then repair files, scan for malware, and test the RAM.

Can XMP or overclocking cause 0x0000013A?

Yes — this is one of the most common hardware triggers. XMP/EXPO memory profiles, manual RAM overclocks, undervolted CPUs, and overclocked GPUs make memory timings unstable, and the kernel heap is the first thing to show damage when they are. Load BIOS optimized defaults and disable XMP/EXPO as a test. If the blue screens stop, your memory kit isn't stable at the rated profile — either keep it at stock speeds, bump the DRAM voltage slightly within the manufacturer's safe range, or replace the kit.

How do I find which driver caused 0x0000013A?

Run Driver Verifier: press Win + R, type verifier.exe, create standard settings for your suspect drivers, and restart — the next crash will usually name the culprit in the dump. You can also inspect the dump directly: open C:\Windows\Minidump in File Explorer, note the newest .dmp file, and open it with WinDbg (free from the Microsoft Store) — the "Probably caused by" line typically names the driver. Graphics drivers are the most common answer, so update them first if you need a quick starting point.

Will reinstalling Windows fix 0x0000013A?

It fixes the software causes — bad drivers, corrupted system files, and malware — but it cannot fix failing RAM, bad disk sectors, or an unstable overclock, and the crashes will come back. Test the memory with mdsched.exe, run CHKDSK, and revert any overclock before a reinstall, since a reset wipes your installed programs. If a fresh Windows install still blue-screens with 0x0000013A, treat it as hardware: RAM first, then the drive, then the motherboard.