MySQL 8.0.27 - memory leak

Hi,

MySQL server seems to be using more memory than it should.

With performance schema i think that the problem is in the following section:
memory/innodb/memory

It has now around 30G and slowly increasing.

What this instrument represents (buffer is another one)? what should be a normal amount of memory for it?

Thanks,

@carlosabr,
What do you have set for innodb_buffer_pool_size ? There are many parameters in MySQL that deal with memory usage. Memory is not entirely allocated at startup. Each connection must allocate new memory. The buffer pool will allocate/lock memory as it needs, depending on the OS in use.

1 Like

Hi,

correct, inno buffer is config to 92G, but this is tracked in memory/innodb/buf_buf_pool which has the same value since the beginning, as far as i know MySQL allocates the buffer all in the beginning and that is why we see that value since the startup, but then yes OS doesn’t really allocate it i believe its called lazy allocation.

But well the problem still stands, other instruments not show much differences over time also the number of connection pretty much the same over the time.

i m aware of some like:
temptable_max_ram - 1G or log size
innodb_log_file_size - 3G (innodb_log_files_in_group default 2)
innodb_log_buffer_size - 1G

So the things i can see changing is this:
memory/innodb/memory

But the does it track? what values should it have? i couldn’t find much information about it.

Thanks,

1 Like

Hi @matthewb

After some time/tries i realise that memory/innodb/memory gets free with a simple analyze table .

I m able to reproduce this in prod and in lab with some load. Any ideas of what it could be?

I can see that memory is not release at OS, but maybe is the allocator (will testing with tcmalloc).

Thanks,

1 Like