mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

unexpected OOM on arm32v7

Open dzharikhin opened this issue 8 months ago • 3 comments

I use mimalloc in https://github.com/pola-rs/polars build via rust bindings https://github.com/purpleprotocol/mimalloc_rust Env is linux on arm32v7 cpu with 32k memory page size the app OOMs way before container memory limit is reached logs and traces are here https://stackoverflow.com/questions/79562449/is-armv7-supported-by-polars

Is there any way to pin the problem?

dzharikhin avatar Apr 17 '25 13:04 dzharikhin

Ah interesting -- I wonder if this is due to the non-standard page size? Is there maybe a setting in the Linux environment wrong that limits commit size to less than total memory for processes?

daanx avatar May 14 '25 01:05 daanx

rust binding 0.1.46 uses sysconf to init page size https://github.com/octavonce/mimalloc/blob/60a6e931aef8cd3081ab8c6c2fd61e101e529229/src/prim/unix/prim.c#L149

I couldn't get the value with gdb(debug symbols for the library are too large to load), but getconf PAGE_SIZE via shell shows 32768 So, I assume its ok

dzharikhin avatar May 14 '25 16:05 dzharikhin

I prepared simple rust repro. Well, at the moment it doesn't fail) But with this I could print memory config of running program

(gdb) print mi_os_mem_config
$2 = {page_size = 32768, large_page_size = 2097152, alloc_granularity = 32768, 
  physical_memory_in_kib = 4173760, virtual_address_bits = 32, has_overcommit = true, 
  has_partial_free = true, has_virtual_reserve = true}

so page_size is ok for sure

dzharikhin avatar May 16 '25 20:05 dzharikhin