-
Notifications
You must be signed in to change notification settings - Fork 890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mimalloc 2.1.9 does not prioritize allocating memory from huge pages #983
Comments
mi_debug_show_arenas: |
Ah I see. I changed the default behavior just before the release -- ouch. Can you try if it is different if you set
In all cases it seems that huge OS pages are only used if explicitly reserved. The reasoning is that using a huge page is a bit "bad" as that memory cannot be shared among other processes or swapped to disk -- so it should only be used if explicitly requested. I wonder though why you see the initial arena being allocated with huge pages .. it means there is an allocation before the huge arena is reserved? |
The following is the log printed during the startup phase of mimaloc. When specifying the use of 8G of huge page memory, it first allocated 1G of normal memory. mimalloc: option 'show_errors': 1 If memory allocation is strictly limited to huge page memory, the program will fail to allocate memory in case of an overflow during runtime. Therefore, I want mimalloc to prioritize allocating from huge pages (for performance reasons) but allow it to fall back to normal memory if huge page memory is exhausted during runtime. In version 2.1.7, mimalloc's behavior aligns with this requirement. In version 2.1.9, is there any explicit configuration to achieve the same effect? |
I try MIMALLOC_ALLOW_LARGE_OS_PAGES=1 but the result still didn't change. |
Hi, I specified the use of huge pages when using mimalloc 2.1.9, and the operating system has enough huge pages available. However, I noticed that upon program startup, 1 GB of memory was allocated from non-hugepage memory first. In version 2.1.7, mimalloc prioritizes allocating memory from hugepage memory until they are exhausted, after which it switches to non-hugepage memory.
The environment variable configuration is as follows:
MIMALLOC_SHOW_STATS=1 MIMALLOC_SHOW_ERRORS=1 MIMALLOC_VERBOSE=1 MIMALLOC_RESERVE_HUGE_OS_PAGES=8 MIMALLOC_RESERVE_HUGE_OS_PAGES_AT=0 MIMALLOC_EAGER_COMMIT_DELAY=0
The text was updated successfully, but these errors were encountered: