Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
11.4.5
-
None
-
Ubuntu 24.04
Fedora 41
Description
Doubled memory usage (11.4.4 <-> 11.4.5)
After updating a productive MariaDB installation to 11.4.5 my monitoring showed that the docker container for MariaDB (official image) is using twice as much memory than with the previous version (around 128MB with 11.4.4 and around 256 MB with 11.4.5).
I checked my config and "SHOW GLOBAL STATUS", but nothing seems to explain that increase in memory usage. After rolling back to 11.4.4, everything is back to normal. This happened on Ubuntu 24.04 LTS (kernel 6.8.0-54-generic).
I can even see a 30% increase with a blank database and default config on my Fedora 41 Workstation. When a client connects, in 11.4.5 the memory usage increases by 90MB (compared to 5MB in the previous version). With a client connected, you can see the 100% increase in memory usage.
I also attached two screenshots showing memory and disk metrics of my production host around the time of downgrading MariaDB 11.4.5 to 11.4.4. It seems noticeable that 11.4.5 also causes higher disk I/O.
# Check memory usage (use dedicated terminal to keep running)
|
docker stats
|
|
# Start containers
|
docker run -d --name mariadb-11.4.4 -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 mariadb:11.4.4
|
docker run -d --name mariadb-11.4.5 -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 mariadb:11.4.5
|
|
# Connect a client
|
docker exec -it mariadb-11.4.4 mariadb
|
docker exec -it mariadb-11.4.5 mariadb
|
|
# Stop containers and cleanup
|
docker stop mariadb-11.4.4 mariadb-11.4.5
|
docker rm mariadb-11.4.4 mariadb-11.4.5
|
Attachments
Issue Links
- is caused by
-
MDEV-20912 Add support for utf8mb4_0900_* collations in MariaDB Server
-
- Closed
-
- relates to
-
MDEV-36361 Wrong utf8mb4_0900_bin alias for utf8mb4_bin (should be utf8mb4_nopad_bin)
-
- Closed
-
Reading through the code I ended in add_alias_for_collation (in mysys/charset.c). I think that is where things go bad.
Usually character sets and collations are lazy loaded, so not touched at all most of the time. This changes here, just before creating the 0900 collation aliases the corresponding 1400 collation is initialized - this adds both, extra allocated memory and processing runtime.
So wondering if we can add these aliases without eager loading the corresponding collation before...