microsoft / microsoft/mimalloc

Can MIMALLOC_RESERVE_HUGE_OS_PAGES reduce memory?

Open
#580 3 comments 0 reactions 0 assignees View on GitHub

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;
![image](https://user-images.githubusercontent.com/27994442/166393408-9cdabc33-c6d4-4afa-b297-587dced7c3e8.png)

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.