Mimalloc: Difference between revisions
Prabuanand (talk | contribs) (created new page for mimalloc) |
Prabuanand (talk | contribs) (added category Category:System Administration) |
||
Line 7: | Line 7: | ||
== Configuration == | == Configuration == | ||
To minimize risks while leveraging mimalloc, consider | To minimize risks while leveraging mimalloc, consider [[#Using mimalloc per-application|per-application preloading]]. | ||
=== Using mimalloc per-application === | === Using mimalloc per-application === | ||
Line 32: | Line 32: | ||
== See also == | == See also == | ||
[https://github.com/microsoft/mimalloc Official website] | [https://github.com/microsoft/mimalloc Official website] | ||
[[Category:System Administration]] |
Latest revision as of 17:46, 27 January 2025
Mimalloc is a drop-in replacement for malloc and can be used in other programs without code changes, for example, on dynamically linked ELF-based systems.
Installation
To use mimalloc, ensure mimalloc package is installed on your Alpine Linux system:
# apk add mimalloc
Configuration
To minimize risks while leveraging mimalloc, consider per-application preloading.
Using mimalloc per-application
Preload libmimalloc.so only for specific applications by issuing the following command:
LD_PRELOAD=/usr/lib/libmimalloc.so my-application
If preloading fails or causes issues, you can unset it temporarily:
unset LD_PRELOAD
To use mimalloc for firefox:
LD_PRELOAD=/usr/lib/libmimalloc.so firefox
Using mimalloc systemwide
To preload libmimalloc.so systemwide, set the LD_PRELOAD environment variable globally by adding the line export LD_PRELOAD=/usr/lib/libmimalloc.so to the global shell configuration file /etc/profile as follows:
Contents of /etc/profile