Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.4.2, 11.5.1
-
None
-
None
-
None
Description
When multiple SHOW STATUS are executed in the same SQL query, MariaDB runs out of memory.
In one terminal, run MariaDB:
docker run -ti --rm --network=host -e MARIADB_ROOT_PASSWORD=root --name=mdb mariadb:11.4 --max-allowed-packet=$((1024*1024*1024))
|
Then in another terminal:
yes "SHOW STATUS WHERE Variable_name IN('Rows_read');"|head -n 1000000|docker exec -i mdb mariadb -uroot -proot --ssl=false --delimiter='$$$$' > /dev/null
|
Adding --memory=8G --memory-swap=8G to the docker run makes it easier to test this without consuming all of the memory on the host system.
The relatively massive memory usage can also be reproduced with the default value of max_allowed_packet. On my system with MariaDB 11.4, executing the SQL with 300k lines of the SHOW STATUS command causes the RSS to peak at about 5GiB after which it returns to 300MiB.