Commit c777429c authored by Monty's avatar Monty

MDEV-33279 Disable transparent huge pages after page buffers has been...

MDEV-33279 Disable transparent huge pages after page buffers has been allocatedDisable transparent huge pages (THP)

The reason for disabling transparent huge pages (THP) is that they
do not work well with MariaDB (or other databases, see links in
MDEV-33279). The effect of using THP are that MariaDB will use much more
(10x) more memory and will no be able to release memory back to the system.

Disabling THP is done after all storage engines are started, to allow
buffer pools and keybuffers (big allocations) to be allocated as huge
pages.
parent 740d3e7a
......@@ -5451,6 +5451,15 @@ static int init_server_components()
#else
locked_in_memory= 0;
#endif
#ifdef PR_SET_THP_DISABLE
/*
Engine page buffers are now allocated.
Disable transparent huge pages for all
future allocations as these causes memory
leaks.
*/
prctl(PR_SET_THP_DISABLE, 1, 0, 0, 0);
#endif
ft_init_stopwords();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment