mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

High virtual memory usage, reset_decommits doesn't work

Open Zeblote opened this issue 3 years ago • 17 comments

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 image
  • Loaded large save image
  • Cleared large save image
  • Loaded large save again image

The initial results using mimalloc:

  • Game started image
  • Loaded large save image
  • Cleared large save image
  • Loaded large save again image

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 image
  • Loaded large save image
  • Cleared large save image
  • Loaded large save again image

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): image image

Zeblote avatar Jan 26 '22 06:01 Zeblote