KERNEL_MODE_HEAP_CORRUPTION (stop code 0x00000013A) means Windows found its kernel heap — the memory region where drivers and the kernel allocate dynamic structures — damaged. Something wrote where it shouldn’t have, and heap validation caught it. Like pool corruption (its close cousin), the writer is usually a buggy driver; the complication is that bad RAM corrupts heap contents in ways that look exactly like a driver bug. So this troubleshooting has two lanes from the start: find the corrupting driver, or prove the hardware.
The diagnostic centerpiece is Driver Verifier with special pool enabled — it makes the corrupting driver crash immediately at the moment of corruption instead of later at validation time, producing a far more informative stop code. But Verifier is the escalation, not the opening move: if the blue screen names a driver, you start there. For pool-type corruption specifically, see our special pool corruption guide ; for the memory-management sibling, see our Memory Management guide .
Why this happens
- Buggy drivers writing out of bounds: Heap buffer overflows in kernel drivers — the primary cause.
- Use-after-free bugs: Drivers accessing heap memory after freeing it, corrupting reused allocations.
- Failing RAM: Hardware-level corruption of heap contents indistinguishable from driver bugs.
- Driver update regressions: New versions introducing heap bugs.
- Corrupt driver binaries: Damaged .sys files misbehaving.
- Antivirus filter drivers: Kernel security hooks with heap-handling bugs.
- Overclocked memory: Unstable RAM timings corrupting heap data under load.
How to fix it
Work through these in order — diagnose first, then act.
Fix 1: Capture the named driver and crash pattern
Classify before acting.
- Photograph the blue screen — note any
.sysfilename with the stop code. - Event Viewer > Windows Logs > System > BugCheck entries: tabulate recent crashes and their named files.
- Consistent file → driver lane (Fix 2). Varying files or Safe Mode crashes → hardware lane (Fix 5).
- Note onset timing — update, new driver, new hardware — and check Microsoft’s support docs for the stop code’s parameter meanings if you’re analyzing deeply.
Fix 2: Replace the implicated driver
Direct action on a named culprit.
- Download the latest driver from the manufacturer. For Intel components, Intel’s detection tool identifies the right package.
- Device Manager > uninstall the device (with driver removal) > clean-install the downloaded driver.
- If crashes began after a driver update, Roll Back Driver instead.
- Test 48 hours under the original trigger conditions — heap corruption is often workload-specific.
Fix 3: Deploy Driver Verifier with special pool
Catch the corrupter in the act.
- Windows + R >
verifier.exe> Create custom settings > enable Special pool, Pool tracking, and Force IRQL checking. - Select driver names from a list — tick only non-Microsoft drivers related to the crash context (graphics, network, storage, USB).
- Restart and use the PC normally. Verifier forces an immediate, well-identified crash (typically DRIVER_VERIFIER_DETECTED_VIOLATION or a special-pool stop) at the corruption moment, naming the driver.
- Mandatory:
verifier /resetand restart after identification or 48 hours. Verifier is a diagnostic instrument, not a permanent setting.
Fix 4: Sweep adjacent drivers and software
Broaden the driver net when Verifier is inconclusive.
- Clean-install GPU drivers (vendor installer, clean-install option), update chipset/network/storage drivers from the laptop vendor.
- Remove third-party antivirus with the vendor’s removal tool and test — filter drivers corrupt heaps.
- Clean-boot (
msconfig, hide Microsoft services, disable all) and bisect to find software culprits. - One change per test cycle; log everything.
Fix 5: Test the RAM definitively
The hardware lane for inconsistent culprits.
mdsched.exe→ restart and check (quick screen).- MemTest86 overnight, 4+ passes, zero errors — the definitive verdict.
- Reseat, isolate sticks individually, replace failures.
- Disable XMP/DOCP in the BIOS and retest — memory overclock instability is a prime heap-corruption source on performance laptops.
Fix 6: Repair system files and check storage
Rule out OS and disk-level corruption.
- Elevated:
sfc /scannow→DISM /Online /Cleanup-Image /RestoreHealth→ SFC again. chkdsk C: /f /r(schedule at restart) — bad sectors corrupt driver binaries and heap-adjacent structures.- Microsoft Defender Offline scan to rule out malware hooking heap functions.
- Recurring corruption after clean repairs → drive diagnostics (F12 > Diagnostics on Dell, F2 on HP).
Fix 7: Stabilize firmware and clocks
Remove the platform variables.
- Update the BIOS from the laptop manufacturer’s support page.
- Update the chipset driver to match.
- Reset all CPU/GPU/RAM overclocks to stock.
- Extended stress test under the original crashing workload before declaring victory — heap bugs hide until the specific allocation pattern recurs.
Closing
Kernel heap corruption troubleshooting is a two-lane road: the driver lane (named file → replace driver → Verifier for confirmation) and the hardware lane (varying files → MemTest86 → stabilize clocks). The mistake is committing to one lane without checking which the evidence points to — replacing RAM for a consistent driver bug, or reinstalling drivers for failing memory. Read the crash pattern first, and the rest of the walkthrough is just execution. Driver Verifier with special pool is the tool that turns “something corrupted the heap” into a named culprit; MemTest86 is the tool that exonerates or convicts the RAM. Between them, this stop code always yields an answer. For the pool-allocation sibling, our special pool guide runs the parallel process. A final note on prevention: heap corruption is overwhelmingly a driver-quality problem, which means your best long-term defense is driver hygiene — prefer vendor drivers over generic ones, avoid installing three overlapping “driver updater” utilities that fight over the same devices, and be skeptical of brand-new driver releases on day one, letting the early adopters find the heap bugs first. If you’re a developer or power user who runs Driver Verifier regularly, remember it’s a diagnostic instrument with real overhead: schedule Verifier sessions deliberately, capture the resulting dumps, and always reset it afterward. And keep a simple log — date, stop code, named driver, what you changed — because heap corruption has a long memory: the driver that corrupted the heap this year is the first suspect when a neighboring stop code appears next year, and your own notes are the fastest diagnostic database you’ll ever own.
