How to set malloc-lib in mysql 5.7 in ubuntu 18.04 LTS I recently installed jemmaloc 3.6.0-11 using apt-get install libjemalloc1 on my ubuntu server 18.04

The installation were successfull, but when I check using

pt-mysql-summary | grep -A5 -i "memory management"


I get

    Memory management library 
    jemalloc is not enabled in mysql config 
for process with id 89539 
    The End 


How I can do this ?

I am using Mysql 5.7.26
I had to do a bit more to get this to work.  This worked for me.  First the problem:
Starting in Ubuntu 18.04, Percona / MySQL are configured thru systemd
This means setting malloc-lib= in my.cnf no longer works!  It also no longer works &quot;out of the box&quot; (at least not for me).
So how do we get this to work?

Create an override.conf file to load jemalloc.  This is done using systemd controls.
sudo systemctl edit mysql

This will pop up an editor.  Unless this has been done before, odds are this will be a blank new file. Enter this in:
[Service]
Environment=&quot;LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1&quot;

Then sudo systemctl daemon-reload which loads the override.conf

Then sudo systemctl restart mysql which restarts the server


Resources:

The heavy lifting: https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/using-systemd.html
Percona blog article: https://www.percona.com/blog/2017/01/03/enabling-and-disabling-jemalloc-on-percona-server/

The instructions on how to verify the jemalloc is actually being used are key.