microsoft / mimalloc

mimalloc is a compact general purpose allocator with excellent performance.
MIT License
10.45k stars 843 forks source link

Mimalloc linked statically using mimalloc.o allocate 1GB heap #849

Closed alphanso closed 7 months ago

alphanso commented 7 months ago

Hi,

I integrated mimalloc and use following options after linking statically MIMALLOC_VERBOSE=1 MIMALLOC_PAGE_RESET=0 MIMALLOC_RESERVE_HUGE_OS_PAGES=5

by setting environment variables.

858489: binary command with args Address Kbytes RSS Dirty Mode Mapping 0000000000200000 948 640 0 r---- binary_name 00000000002ed000 3860 3348 0 r-x-- binary_name 00000000006b2000 44 44 8 r---- binary_name 00000000006bd000 168 96 36 rw--- binary_name 00000000006e7000 356 56 56 rw--- [ anon ] 000002f902000000 1048576 11700 11700 rw--- [ anon ]

I believe address 000002f902000000 is heap address and it is allocating 1 GB. Is this correct behavior

mimalloc: process init: 0x7f391692f980 mimalloc: secure level: 0 mimalloc: mem tracking: none mimalloc: using 1 numa regions mimalloc: numa node 0: reserved 5 GiB huge pages (of the 5 GiB requested) mimalloc: option 'show_errors': 0 mimalloc: option 'show_stats': 0 mimalloc: option 'verbose': 1 mimalloc: option 'eager_commit': 1 mimalloc: option 'arena_eager_commit': 2 mimalloc: option 'purge_decommits': 1 mimalloc: option 'allow_large_os_pages': 0 mimalloc: option 'reserve_huge_os_pages': 5 mimalloc: option 'reserve_huge_os_pages_at': -1 mimalloc: option 'reserve_os_memory': 0 mimalloc: option 'deprecated_segment_cache': 0 mimalloc: option 'deprecated_page_reset': 0 mimalloc: option 'abandoned_page_purge': 0 mimalloc: option 'deprecated_segment_reset': 0 mimalloc: option 'eager_commit_delay': 1 mimalloc: option 'purge_delay': 10 mimalloc: option 'use_numa_nodes': 0 mimalloc: option 'limit_os_alloc': 0 mimalloc: option 'os_tag': 100 mimalloc: option 'max_errors': 16 mimalloc: option 'max_warnings': 16 mimalloc: option 'max_segment_reclaim': 8 mimalloc: option 'destroy_on_exit': 0 mimalloc: option 'arena_reserve': 1048576 mimalloc: option 'arena_purge_mult': 10 mimalloc: option 'purge_extend_delay': 1 mimalloc: reserved 1048576 KiB memory