[MDEV-17758] Query to INFORMATION_SCHEMA.TABLES leads to huge memory usage Created: 2018-11-17  Updated: 2019-01-27  Resolved: 2019-01-27

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.2.19
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Igor Blinder Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: need_feedback
Environment:

OC: Cloulinux/CentOS 7.5
mysql Ver 15.1 Distrib 10.2.19-MariaDB, for Linux (x86_64) using readline 5.1


Attachments: Text File after_pmap.log     Text File before_pmap.log     File my.cnf     HTML File show_engine_innodb_status     HTML File show_status     HTML File show_variables    

 Description   

The bug similar to https://bugs.launchpad.net/percona-server/+bug/1380895

Sometimes after execution requests to INFORMATION_SCHEMA.TABLES mysql use more and more memory.

SELECT TABLE_SCHEMA as DB,SUM(DATA_LENGTH)+SUM(INDEX_LENGTH) AS SPACEUSED from information_schema.tables WHERE TABLE_TYPE NOT LIKE '%view%' GROUP BY TABLE_SCHEMA;

Memory usage before request. pmap out before request in attach before_pmap.log

/bin/ps -ylC mysqld | /bin/awk '{x += $8;y += 1} END {print "Memory Usage (MB): "x/1024, "\n\n"}'
Memory Usage (MB): 51782.2

Execution request.

Memory usage after request. pmap out after request in attach after_pmap.log

/bin/ps -ylC mysqld | /bin/awk '{x += $8;y += 1} END {print "Memory Usage (MB): "x/1024, "\n\n"}'
Memory Usage (MB): 51865.5

Increasing of memory usage happens not every request.
Unfortunately i don't know exact conditions to reproduce memory leak, but if sometimes run this request on working server where running another sql requests, creates and dropping databases/tables, memory leak happens.



 Comments   
Comment by Elena Stepanova [ 2018-12-29 ]

The query from information_schema opens a lot of tables – all tables, in fact – so it doesn't appear surprising that it might use some memory. The question is, whether there is a leak, whether the growth continues over the time, and whether it growth beyond what you'd expect if the number of tables also increases. I don't see in your report any indication of one way or another, so could you please clarify, do you observe a leak?

Generated at Thu Feb 08 08:38:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.