Context
In order to troubleshoot memory allocations we may need to capture jemalloc allocations statistics using the jem-stats info command.The info command is used to dump JEMalloc's internal statistics as well as Aerospike memory accounting information (i.e site_info records.)
jem-stats:file=[...];options=[...];sites=[...]
The first two options to the info command concern JEMalloc's internal statistics:
- The
fileoption specifies the file to receive JEMalloc's internal statistics. The internal statistics are dumped via JEMalloc'sjem_malloc_stats_print(). If nofileoption is specified, the internal statistics are dumped to the Aerospike log file.
- The
optionsoption is simply forwarded to the options parameter ofjem_malloc_stats_print(). - If specified, the
sitesoption indicates that we would also like to dump thesite_inforecords for all threads and all allocation sites. The option specifies the file to which to dump this information. The resulting file contains lines like the following, each of which describes onesite_inforecord.
Method
We can capture jem-stats with following command:asinfo -v 'jem-stats:file=/tmp/jem.txt;sites=/tmp/sites.txt
The sites.txt output requires debug-allocations to be enabled to all in aerospike.conf.
service {
...
debug-allocations all
}
This setting is static and will require a rolling restart of the nodes.