Windows Internals Day 4 Course Trainsec

Windows Internals: Day 4 of 5, the Memory Management Course

See how Windows manages virtual and physical memory. Pavel Yosifovich, co-author of Windows Internals, covers page states, memory counters, address translation, page faults, working sets, heaps, kernel pools and memory mapped files, with live demos in Visual Studio, Sysinternals tools and the kernel debugger.

31 Lessons
Lifetime access

$139

blue depth
Windows Internal master badge 1

This course is part of Windows Internals Master

$1356 or $140 X 10 installments
Trusted by 10K+ students and companies
Sentinel one logo white
microsoft logo white
google logo white
mandiant logo white
intel logo white
cisco white logo tr
citibank logo white
alfa bank logo white
malwarebytes logo white
proofpoint logo white
epam logo white
Sentinel one logo white
microsoft logo white
google logo white
mandiant logo white
intel logo white
cisco white logo tr
citibank logo white
alfa bank logo white
malwarebytes logo white
proofpoint logo white
epam logo white

5+ hours

on-demand video

Live demos

in Sysinternals tools and WinDbg

29

video lessons

2

downloadable PDFs

5 CPE

CEU credits, self-reported

Certification

Certificate of completion

Windows memory management course: see how Windows manages virtual and physical memory

This Windows memory management course is taught by Pavel Yosifovich, co-author of Windows Internals, 7th Edition, Part 1 (Microsoft Press). It is devoted entirely to the Windows memory manager: page states, sharing and protection, x86, PAE and x64 address translation, page faults, page files, working sets, heaps, kernel pools and memory mapped files.

It is the fourth of the five courses in the series, and it mixes slides with live demos in Visual Studio, Sysinternals tools and the kernel debugger.

The course has 29 pre-recorded video lessons, 5 hours 24 minutes of video, with English captions, plus the slides PDF and the labs PDF. You learn at your own pace, with lifetime access.

Pavel Yosifovich
Pavel Yosifovich
Developer, trainer, author and (sometimes) speaker. Co-founder of TrainSec academy.

Pavel has been working at the lowest levels of Windows for more than 25 years, as a developer, consultant, trainer, author and speaker, and is a Microsoft MVP. He is the co-author of “Windows Internals, 7th Edition, Part 1” (Microsoft Press) and the author of “Windows Kernel Programming”, “Windows 10 System Programming” and “Windows Native API Programming”.

In this course he explains how the Windows memory manager works, and shows it live in Sysinternals tools and the kernel debugger.

What will you learn about the Windows memory manager?

Who is this Windows memory management course for?

  • Windows developers who want to know what VirtualAlloc, heaps, malloc and new really do and how to diagnose memory usage and leaks.
  • Driver and kernel developers who need to understand paged and non-paged pool, pool tags and address translation.
  • Security researchers and reverse engineers who need a solid model of virtual memory, page protection, ASLR and cross-process memory access.
  • Students who finished Windows Internals Days 1 to 3 and are continuing through the series.
  • Performance and troubleshooting engineers who want to read memory counters correctly.
  • Anyone working through the Windows Internals Master learning path.

Not the right fit if you are completely new to Windows internals (start with Windows Internals: Day 1), if you want the I/O system, driver model or security architecture (Windows Internals: Day 5), a hands-on programming course (Windows System Programming 1 or Windows Kernel Programming 1), or deep CPU-level paging and assembly (x64 Architecture and Programming (Part 2)).

What do you need before you start?

  • Windows Internals Days 1 to 3 are recommended. Day 4 assumes you know processes, threads, basic virtual memory and WinDbg from Windows Internals: Day 1, and it touches on SEH and IRQL, which Day 3 covers.
  • Being able to read C and C++ helps, since some demos are written in Visual Studio. It is not primarily a coding course.
  • You only need a browser to watch the lessons. To follow along, the demos use Visual Studio, WinDbg in local kernel debugging mode, and free tools such as VMMap, RAMMap, Process Explorer and PoolMonX, all on Windows 10 or 11.

What does this Windows memory management course cover?

The course has nine chapters: an introduction, memory fundamentals, sharing and protection, virtual address translation, physical memory, memory usage in user mode and in the kernel, memory mapped files, and a closing chapter on large pages, ASLR, enclaves, locking memory, compression and combining.

It is part of the Windows Internals Master learning path and the Windows Internals Bundle.

What is the difference between reserved and committed memory in Windows?

Committed memory is guaranteed to be available when accessed, while reserved pages only set aside a contiguous address range without consuming resources. The thread stack is the classic example: a reserved maximum with pages committed on demand through the guard page. A 29-minute demo compares commit-everything with MEM_RESERVE and on-demand commits using an SEH exception filter, and shows reserving up to 100 TB of address space at no commit cost.

Which Windows memory counter should you watch for leaks?

Commit size is the counter to watch for consumption and leaks. Commit size in Task Manager equals private bytes in Process Explorer and Performance Monitor. Working set is the memory accessible without a page fault, and virtual size is the only counter that includes reserved memory. A 30-minute lesson then tours a process address space in VMMap. For a first look at that tool, read our VMMap basics post.

How does Windows translate virtual addresses to physical memory?

The course walks through x86 two-level paging, PAE and the four levels of x64 translation, large and huge pages and the TLB, then verifies a translation in the kernel debugger. It looks at translation as part of the whole Windows memory manager. For the processor’s point of view with assembly, see x64 Architecture and Programming (Part 2).

What happens on a page fault, and what does the page file really back?

You learn the difference between hard and soft page faults. Page files back only private, writable, committed memory, while images and mapped files are their own backing store, which is why a loaded DLL cannot be deleted. The course covers multiple page files, sizing, what a crash dump requires, and the commit limit, which is RAM plus the current page file size, together with the VADs that track address ranges.

How does Windows manage physical memory with working sets and page lists?

You follow working sets, the system working set and the PFN database, then the bad, free, zero, standby and modified page lists, the zero page thread, the modified page writer and eight memory priority levels. The demos use WinDbg commands, RAMMap, Process Explorer and Task Manager.

How do VirtualAlloc, heaps, malloc and new relate to each other?

The Virtual API sits close to the memory manager and works at page granularity. The Heap API is a layer above it, and in the Microsoft runtime malloc and new call HeapAlloc on the default process heap. The course explains the legacy GlobalAlloc and LocalAlloc family, why to create additional heaps, fragmentation, the Low Fragmentation Heap and the Segment Heap. For writing this kind of code, see Windows System Programming 2.

What is the difference between paged and non-paged pool?

Non-paged pool always stays in physical memory, while paged pool can be paged out, so kernel code must pick the right one. The course covers the kernel pool APIs, including ExAllocatePool2 and ExAllocatePool3, why the kernel does not free driver allocations when a driver unloads, and how to find leaks with PoolMonX. See also our post on kernel allocation tags, and Windows Kernel Programming 1 for writing drivers.

How do memory mapped files share memory between processes?

Memory mapped files are section objects, shareable kernel objects backed by the page file or by a file and accessed through views. A 26-minute Visual Studio demo shares a string between processes and shows the section object in Process Explorer. With page file backing the data disappears when the last handle closes, and with file backing it persists.

What does this course explain about ASLR, page protection and cross-process access?

As concepts, the course covers ASLR and DLL relocation and why ASLR does not fully stop shellcode that walks the TEB and PEB, page protection constants such as PAGE_GUARD, ReadProcessMemory and WriteProcessMemory, and memory enclaves. It explains how these mechanisms work and is not an exploit development course.

Which tools and downloads does this course use?

The demos use Visual Studio, VMMap, Process Explorer, Task Manager, WinDbg in local kernel debugging mode, RAMMap, PoolMonX and Object Explorer. The Day 4 slides and labs PDFs are included.

What should you take after Day 4?

Windows Internals: Day 5 completes the series with the I/O system, drivers and Windows security. Mastering WinDbg pairs well with this course, since Day 4 uses kernel debugger commands that it teaches in depth, and Sysinternals Tools Deep Dive 1 covers VMMap as one tool among many.

To buy all five days together, see the Windows Internals Bundle. The Windows Internals Master learning path also includes this course.

What does each chapter of the course cover?

Introduction

What Day 4 covers: physical and virtual memory, page states, sharing, protection, address translation, page faults, page files, memory mapped files, large pages and ASLR.

Memory Fundamentals

The memory manager’s job, page sizes, and the free, committed and reserved page states, demonstrated with VirtualAlloc and an on-demand commit pattern using SEH. Also the VMMap tool and its memory categories, and the working set, private bytes, commit size and virtual size counters.

Sharing and Protection

How Windows shares DLL and executable code, with ASLR and relocation effects, copy-on-write data and explicitly shared data sections. Then cross-process access with ReadProcessMemory and WriteProcessMemory, and per-page protection through VirtualAlloc and VirtualProtect.

Virtual Address Translation

32-bit and 64-bit process layouts, the large address aware flag, x64 limits, and the x86, PAE and x64 paging schemes with valid bits, large and huge pages. A kernel debugger translation demo, then hard and soft page faults, page files and sizing, and commit charge with VADs.

Physical Memory

Working sets, the system working set and the PFN database, then the bad, free, zero, standby and modified page lists, the zero page thread and eight memory priority levels, viewed with WinDbg commands, RAMMap, Process Explorer and Task Manager.

Memory Usage: User Mode

The heap manager (default process heap, extra heaps, fragmentation, Low Fragmentation Heap and Segment Heap) and how the Virtual API, Heap API, C/C++ runtime and legacy Global and Local APIs relate to each other.

Memory Usage: Kernel

Pageable and non-pageable code, the file system cache, and paged and non-paged pool with their limits. Then the kernel pool APIs, pool tags, leak tracking and a PoolMonX demonstration.

Memory Mapped Files

Section objects, their file or page file backing, and sharing between processes. A Visual Studio MFC demo shares a string across processes and shows the section object in Process Explorer, with the user-mode and kernel APIs summarized.

Miscellaneous Topics

Large pages and their requirements, ASLR, memory enclaves (SGX and VBS), locking memory, memory compression and memory combining, followed by the wrap-up of the memory module.

Windows memory management course: frequently asked questions

Do I need to take Days 1 to 3 before Day 4?

They are recommended. Day 4 assumes you know processes, threads, basic virtual memory and WinDbg from Day 1, and it touches on SEH and IRQL, which Day 3 covers.

What is the difference between reserved and committed memory?

Committed memory is guaranteed to be available when accessed. Reserved memory only sets aside a contiguous address range and consumes no commit.

Which counter shows a memory leak?

Commit size, which Process Explorer and Performance Monitor call private bytes. Working set only shows memory accessible without a page fault.

What is the difference between a hard and a soft page fault?

A hard page fault needs to read the data from disk. A soft page fault is resolved from memory, without disk access.

What is the difference between paged and non-paged pool?

Non-paged pool always stays in physical memory. Paged pool can be paged out.

Does it cover the I/O system, drivers or Windows security?

No. Those topics are in Windows Internals: Day 5. Day 4 covers only memory, though it does explain kernel pool usage relevant to drivers.

What software do I need to follow along?

The demos use Visual Studio (C++), WinDbg in local kernel debugging mode, and free tools such as VMMap, RAMMap, Process Explorer and PoolMonX, all on Windows 10 or 11. You only need a browser to watch the lessons.

Is this a coding course?

Not primarily. It explains how the memory manager works, with some C/C++ demos in Visual Studio. For hands-on programming, Windows System Programming 1 or Windows Kernel Programming 1 are the better fit.

How is this different from x64 Architecture and Programming (Part 2)?

x64 Part 2 explains paging from the processor’s point of view with assembly. Day 4 explains how Windows itself manages memory, including page files, working sets, heaps, pools and memory mapped files.

Is the course live or recorded?

Pre-recorded and self-paced on the TrainSec learning platform.

How long is the course?

29 video lessons with 5 hours 24 minutes of video, plus the slides and labs PDFs. All video lessons have English captions.

Can I watch a lesson before I buy?

Yes. Memory Management Basics is free to preview. You can watch it on the course page on the learning platform.

Do I get a certificate?

Yes. When you complete every lesson you receive a certificate of completion and a Credly badge. The course earns 5 CPE/CEU credits, which you self-report to your certification body with your TrainSec certificate.

How much does it cost, and is there a payment plan?

$139 as a single payment; there is no payment plan for this course. The Windows Internals Bundle ($849, or 6 x $148) and the Windows Internals Master learning path ($1,356, or 10 x $140) include it and do offer payment plans.

How long do I have access?

Lifetime access, including future updates to the course.

What is the refund policy?

Refunds are available up to 14 days after purchase, to the original payment method. Email [email protected] to request one.

What should I take after Day 4?

Windows Internals: Day 5 completes the series. Mastering WinDbg and the x64 Architecture and Programming courses are good companions.

Pavel Yosifovich
Pavel Yosifovich
Developer, trainer, author and (sometimes) speaker. Co-founder of TrainSec academy.

Pavel has been working at the lowest levels of Windows for more than 25 years, as a developer, consultant, trainer, author and speaker, and is a Microsoft MVP. He is the co-author of “Windows Internals, 7th Edition, Part 1” (Microsoft Press) and the author of “Windows Kernel Programming”, “Windows 10 System Programming” and “Windows Native API Programming”.

In this course he explains how the Windows memory manager works, and shows it live in Sysinternals tools and the kernel debugger.

Windows Internals Day 4 Course Trainsec
Windows Internals: Day 4 of 5

See how Windows manages virtual and physical memory. Pavel Yosifovich, co-author of Windows Internals, covers page states, memory counters, address translation, page faults, working sets, heaps, kernel pools and memory mapped files, with live demos in Visual Studio, Sysinternals tools and the kernel debugger.