Debugging Memory Usage

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:

On CentOS :

sudo yum install gperftools 
service mariadb stop
systemctl edit mariadb

This will open an editor.

Add this content and close the file:


Then run

service mariadb start

Then, run the workload. When memory consumption becomes large enough, ruh

ls -la /tmp/heap-prof-*

This should show several files.

Copy away the last one of them:

cp /tmp/heap-prof-1.0007.heap .

Then, run

pprof --dot /usr/sbin/mysqld heap-prof-1.0007.heap  >

(Note: this produces a lot of statements like /bin/addr2line: Dwarf Error: ... . Is this because it cannot find locations from the plugin .so files in mariadbd? Anyhow, this is not a showstopper at the moment)

Then, please send us the file.


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.