Memlock limit exceeded
When using Arm SPE profiling on a system with many logical cores, you can encounter an error regarding an inability to mlock any further memory. This can occur during Linaro MAP profiling initialization or when an MPI or user program attempts to mlock memory.
In order to receive Arm SPE data, Linaro MAP must mmap
a number of buffers
per logical CPUs on the host system. This can sum to a significant
amount of memory when the number of logical CPUs is high. In combination
with the mlock needs of the target application the system mlock resource
limit may be exceeded, preventing more memory from being locked.
Solution
Raise the system soft cap to some higher value using ulimit -l
.
Solution
Modify the size of the largest buffers Linaro MAP maps per core using the
environment variable FORGE_SAMPLER_SPE_AUX_BUFFER_SIZE
. This is the
number of pages to mmap
for each logical core on the system.
It must be a positive power of 2.
Setting this environment variable too low reduces the amount of Arm SPE data that can be processed by MAP, reducing the number of SPE samples samples obtained.