MySQL memory leaks when dropping a database that has many partitioned tables.
1. Start mysqld. For example, you can use this command:
2. Make sure innodb_file_per_table is ON
3. Start watching memory usage of the mysqld process:
4. Open a new terminal and run the attached test case. It creates 100 tables, each having 8100 partitions, then drops the database holding these tables.
5. You will notice that memory usage will increase. In my case, it was 0,37% RAM after the first few tables were created, 12.19% while DROP DATABASE was running, and 9.23% when DROP DATABASE finished. Memory usage did not decrease further.
6. Run the test second time and watch memory usage.
In my case it grew up to 19.33%, then lowered down to 16.39%.
We have two issues here.
1. Significant memory use increase after creating 100 partitioned tables, then dropping the database that holds them.
2. The fact that after the second test run memory usage increased by the almost same amount.
In both cases, memory was not freed once the job is done.
Upstream exhibits the same behavior for the test run, but after the second run memory use increased only by 0.1% that makes this behavior not so critical