dotnet / dotnet/runtime

Use MEM_64K_PAGES on Windows

Open
#131,709 8 comments 0 reactions 0 assignees View on GitHub
area-GC-coreclr os-windows tenet-performance
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

### Description
It seems that Windows 10 VirtualAlloc2 provides a new flag, `MEM_64K_PAGES` that's a hint that lets it page memory more efficiently.

The only requirement it seems is that the allocation size and base must be 64kB aligned.

AFAIR dotnet already aligns the sizes to 64kB due to that being the allocation granularity on Windows so it seems to me that this could be used by GC and VM if the API is available?

cc @jkotas if you see any issue here

### Configuration
Windows

### Regression?
n/a

### Data
https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualalloc2

Contributor guide

Open the contributing guide

Research direction

Start with the VirtualAlloc2 documentation linked in the issue, then locate the Windows-specific GC and VM allocation paths that could use the flag. Confirm the existing 64 kB alignment assumptions and API availability; done means the hint is applied safely where supported without changing behavior elsewhere.

Written by the indexing model from the issue text.

Assessment

Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.