microsoft / microsoft/mimalloc
Can MIMALLOC_RESERVE_HUGE_OS_PAGES reduce memory?
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 13.4k
- Forks
- 1.2k
- Avg merge
- 4d 45m
- Merged PRs (30d)
- 13
Description
Hi, here is my observation from Task Manager on Windows:
when `MIMALLOC_RESERVE_HUGE_OS_PAGES==0`, my program occupies 1200MB memory;
when `MIMALLOC_RESERVE_HUGE_OS_PAGES==2`, my program occupies 800MB memory;

2 questions here:
1. For `MIMALLOC_RESERVE_HUGE_OS_PAGES==2`, I think os need to reserve 2GB memory for my program, why only 800MB here?
2. Why `MIMALLOC_RESERVE_HUGE_OS_PAGES==2` need less memory than `MIMALLOC_RESERVE_HUGE_OS_PAGES==0`?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the MIMALLOC_RESERVE_HUGE_OS_PAGES setting and the reported Windows Task Manager measurements. Determine why reserving two huge pages reports about 800 MB rather than 2 GB and why that setting changes the observed memory usage; done means answering both questions with evidence from the allocator’s documented behavior or implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- operating-systems, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100