A workload that uses a lot in-memory temporary tables makes the mysqld process grow until it fills all the avaialble system memory and eventually the process is killed by OOM killer.
While verifying this in my lab, I also found that the above statement is also using the ibtmp1 tablespace, and makes it grow enormously (it filled my disk during the test run).
According to the documentation, the memory allocated by CREATE TEMPORARY TABLE .. ENGINE=MEMORY should be released when the session is terminated, however, this doesn't seem to be the case. Also, the enormous growth of the temporary innodb tablespace is kind of unexpected - only way to reclaim this space is to restart MariaDB.
How to reproduce:
I am attaching the LUA file to this ticket.
While this runs, you can monitor mysqld footprint and ibtmp1 growth with: