tikv / jemallocator

Rust allocator using jemalloc as a backend
Other
332 stars 52 forks source link

Unsupported system page size #80

Closed mdecimus closed 2 months ago

mdecimus commented 2 months ago

Hi,

We are using jemalloc in our project and some Linux ARM64 users with aPAGE_SIZE of 16384 have reported the following error when executing our precompiled binaries:

<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed
Aborted (core dumped)

If the user compiles the binaries locally on their machines, there are no issues, so this seems to indicate that jemalloc expects the same page size the host had at compile time. Our distributed binaries are compiled on a Github CI runner instance using cross with a 4KB page size I believe.

My question is if it is possible to make jemalloc work on a machine that has a page size different to the one where the binary was compiled?

BusyJay commented 2 months ago

Yes, just tell jemalloc a large page size by environment variable JEMALLOC_SYS_WITH_LG_PAGE. It works fine as long as the given size is larger than the actual size.

mdecimus commented 2 months ago

Thank you!