Windows
Windows heap learning
Windows Heap Internals learning windows heap is divided into two types:NT heap and segment heap NT heap Exists since early versions of Windows NT. The default heap implementation up through Windows 7/8. Segment heap (why not public) Introduced in Windows 10 as the modern heap manager. Default for apps built with the Universal Windows Platform (UWP), Microsoft Edge, and newer apps. Heap structure A heap consist of some segments.Each segment has a continuous space. A segment consist of some Entry Here is the structure of heap: ...
Windows内存管理学习
一. 关于内存管理 1.1 虚拟地址空间 每个进程的虚拟地址是私有的并且无法被其他进程访问(除非共享)。系统为每个进程维护一个页表用来将虚拟地址变为物理地址。 虚拟地址空间的大小受到不同的cpu架构,不同的windows操作系统和LargeAddressAware与 4GT 设置影响。 1.1.1 32位 ——4GT设置 在 32 位系统中,虚拟地址是 4 GB(2³² = 4 GB): 默认情况:用户程序最多只能访问 2 GB 的虚拟地址 启用 4GT 后分布变成: 这样用户态程序能用更多虚拟内存(适合数据库、游戏服务器等),但内核空间只有 1 GB,系统缓存和驱动可用空间变少。 启用方式 Windows Vista 及更高版本:bcdedit /set increaseuserva <值> Windows Server 2003 及更早:在 Boot.ini 中添加: /3GB 或者更细调 /USERVA=2560 让程序识别 4GT —— /LARGEADDRESSAWARE 编译时加: link /LARGEADDRESSAWARE myapp.obj 没加此标志 → 即使系统启用了 4GT,程序仍只能看到 2 GB。 加了 → 在 /3GB 系统上可看到 3 GB,在 64 位系统上甚至可用 4 GB。 ...