microsoft / microsoft/mimalloc
High virtual memory usage, reset_decommits doesn't work
- Dominant language
- C
- Stars
- 13.4k
- Forks
- 1.2k
- Avg merge
- 4d 45m
- Merged PRs (30d)
- 13
Description
Hi! I'm evaluating using mimalloc-secure 2.0.3 for our game instead of Unreal Engine's default FMallocBinned2.
The runtime performance seems good, I have not measured any significant regression from this switch.
However, it seems to not decommit memory nearly as much if the memory usage of the game goes down.
My configuration:
MI_SECURE = 4
The target for comparison, using FMallocBinned2:
- Game started

- Loaded large save

- Cleared large save

- Loaded large save again

The initial results using mimalloc:
- Game started

- Loaded large save

- Cleared large save

- Loaded large save again

That's... not great in comparison.
I enabled the options page_reset, abandoned_page_reset, gives significant improvements for the working set, but no improvement on unnecessary memory being decommitted again.
- Game started

- Loaded large save

- Cleared large save

- Loaded large save again

The option segment_reset seems to not be hooked up to anything.
The option reset_decommits causes the game to crash instantly during static initialization, if page_reset is also enabled (otherwise it does nothing):


Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the handling for page_reset, abandoned_page_reset, segment_reset, and reset_decommits, then reproduce the static-initialization crash with MI_SECURE=4 and page_reset enabled. Compare the decommit behavior after memory usage falls. Done means reset_decommits no longer crashes or silently does nothing, and the reported decommit behavior is covered by validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100