My Oracle Support Banner

How to inspect and diagnose MySQL heap memory fragmentation and excessive memory use (Doc ID 2798321.1)

Last updated on FEBRUARY 28, 2023

Applies to:

MySQL Server - Version 5.6 to 8.0 [Release 5.6 to 8.0]
Linux x86-64
Linux x86


MySQL for Linux is built using GLIBC and uses the default GLIBC memory allocator.  In some workloads the GLIBC memory allocator can cause excessive memory usage because of fragmentation.  Third party memory allocators such as jemalloc and tcmalloc do not seem to exhibit this shortcoming.

The objective is to peek into the GLIBC memory allocator and try to gather information that can help inform a diagnosis which determines if fragmentation is the cause of excessive memory usage.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document
 Malloc stats
 Getting data
 How Malloc works
 Analysis of heap data
 MySQL memory usage
 Interpreting the results

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.