Documentation Home
MySQL 9.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.0Mb
PDF (A4) - 40.1Mb
Man Pages (TGZ) - 259.0Kb
Man Pages (Zip) - 366.2Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 9.0 Reference Manual  /  ...  /  MLE Component Memory and Thread Usage

7.5.6.3 MLE Component Memory and Thread Usage

Memory allocation and usage information for the MLE component can be obtained by checking the values of the Mle_heap_status and Mle_memory_used status variables. Memory is not allocated until the component is activated by creating or executing a stored program that uses JavaScript. This means that, until the component is active, the value of Mle_heap_status is Not Allocated and Mle_memory_used is 0. When the component is active, Mle_heap_status should be Allocated, and Mle_memory_used should be an integer in the range of 0 to 100 inclusive; the latter variable indicates the memory used by the MLE component as a percentage of the amount allocated to it, rounded up to the nearest whole number. It is also possible for Mle_heap_status to be Garbage Collection, should it become necessary to reclaim memory that is no longer being used.

By default, the amount of memory allocated to the MLE component is 64MB (67108864 bytes). You can adjust this by setting the mle.memory_max system variable up to a maximum of 8GB (8589934592 bytes); the minimum possible value is 32MB. When increasing this, you should keep in mind that sufficient memory must remain for other uses by the MySQL server, and for system processes to operate correctly.

Setting mle.memory_max to a value that is greater than the total amount of memory on the system causes undefined behavior.

Important

You can change the amount of memory allocated to the MLE component only when the component is inactive. To set the allocation to a non-default value at install time, use a statement such as INSTALL COMPONENT 'file://component_mle' SET GLOBAL mle.memory_max = 1024*1024*512, or set it after installing but before making any use of JavaScript stored programs.

You can obtain the number of out of memory errors that have been raised by MLE stored programs by checking the value of the Mle_oom_errors status variable.

For information about threads used by the Multilingual Engine Component, you can consult the Mle_threads status variable, which shows the current number of physical threads attached to GraalVM. Mle_threads_max shows the maximum number of simultaneous physical threads attached to GraalVM at any point in time since the component became active.