Rate This Document
Findability
Accuracy
Completeness
Readability

-ljemalloc

Description

This option enables the jemalloc library, which is a common malloc implementation that focuses on reducing memory fragments and improving concurrency performance. It is integrated into GCC for openEuler as a dynamic library.

Usage

The compiler has a built-in jemalloc library, which is located in the gcc-12.3.1-2025.12-aarch64-linux/lib64 directory of the compiler. You can enable the library by using the following options:

1
-L/opt/aarch64/compiler/gcc-12.3.1-2025.12-aarch64-linux/lib64 -ljemalloc

Result

After the application software is compiled, run the ldd command to check whether the executable file successfully calls the jemalloc library. Taking wrf as an example, run the following command:

1
ldd wrf.exe

If the information in the red box in the following figure is displayed, the calling is successful. If not, check whether the jemalloc library is loaded to the default path of the system. For details about the configuration method, see the preceding description.