mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

The size of the coredump file generated when the process crashes is too large.

Open TechVortexZ opened this issue 10 months ago • 4 comments

I use mimalloc on the arm64 platform. When I use kill -11 to make the process generate a coredump file, the size of this coredump file is more than double that of not using mimalloc.

The first line below is the coredump file generated using mimalloc, and the second line is the coredump file generated without mimalloc: ` -rw-------. 1 root root 2.9G 1月 1 2024 core-perception-4598-1704038613

-rw-------. 1 root root 1023M 1月 1 2024 core-perception-4666-1704039050 ` This affects our normal debugging and use. Is there any solution?

TechVortexZ avatar Feb 22 '25 09:02 TechVortexZ

Difficult to say why this happens. May try running with the MIMALLOC_ARENA_EAGER_COMMIT=0 environment option -- this will only reserve but not yet commit virtual memory which may reduce the core dump?

daanx avatar Feb 24 '25 19:02 daanx

I’ve encountered the same issue. This occurs because mimalloc pre-allocates several 1GB chunks of virtual memory, and during core dump generation, these virtual memory blocks are preserved (even if they are unused). However, I haven’t found an effective solution to address this yet.

zhanjunyu-cvte avatar Mar 13 '25 07:03 zhanjunyu-cvte

I would think MIMALLOC_ARENA_EAGER_COMMIT=0 would help in that case as the memory should be just "reserved" and thus not needed for the core dump?

What system is this on? macOS? Linux? Perhaps we can use MADV_DONTDUMP to reduce the core for virtual reserve?

daanx avatar Mar 20 '25 04:03 daanx

I would think MIMALLOC_ARENA_EAGER_COMMIT=0 would help in that case as the memory should be just "reserved" and thus not needed for the core dump?

What system is this on? macOS? Linux? Perhaps we can use MADV_DONTDUMP to reduce the core for virtual reserve?

On embedded Linux, I compress core dumps which exhibit high compression ratios due to their sparse memory content.

zhanjunyu-cvte avatar Mar 20 '25 06:03 zhanjunyu-cvte