Debugging memory usage

You are viewing an old version of this article. View the current version here.

Debugging memory usage on CentOS 7.

This page describes how to debug MariaDB's memory usage. It uses CentOS 7 but can be applied to other systems as well.

The idea is to employ Google PerfTools: https://gperftools.github.io/gperftools/heapprofile.html

On CentOS :

sudo yum install gperftools 
service mariadb stop
systemctl edit mariadb

This will open an editor.

Add this content and close the file:

[Service]
Environment="HEAPPROFILE=/tmp/heap-prof-1"
Environment="HEAP_PROFILE_ALLOCATION_INTERVAL=10737418240"
Environment="HEAP_PROFILE_INUSE_INTERVAL=1073741824"
Environment="LD_PRELOAD=/usr/lib64/libtcmalloc.so.4"

Then run

service mariadb start

Then, run the workload.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.