Bug #106342 Minimum value for global_connection_memory_limit variable
Submitted: 1 Feb 2022 5:24 Modified: 1 Feb 2022 14:29
Reporter: Chelluru Vidyadhar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0.28 OS:Any
Assigned to: CPU Architecture:Any

[1 Feb 2022 5:24] Chelluru Vidyadhar
Description:
As per documentation, the minimum value for global_connection_memory_limit variable is 2097152. However, the accepted minimum value is 16777216.

mysql> show global variables like '%mem%';
+---------------------------------------+----------------------+
| Variable_name                         | Value                |
+---------------------------------------+----------------------+
| connection_memory_chunk_size          | 8912                 |
| connection_memory_limit               | 18446744073709551615 |
| global_connection_memory_limit        | 18446744073709551615 |
| global_connection_memory_tracking     | ON                   |
| histogram_generation_max_mem_size     | 20000000             |
| internal_tmp_mem_storage_engine       | TempTable            |
| locked_in_memory                      | OFF                  |
| optimizer_trace_max_mem_size          | 1048576              |
| parser_max_mem_size                   | 18446744073709551615 |
| performance_schema_max_memory_classes | 450                  |
| range_optimizer_max_mem_size          | 8388608              |
+---------------------------------------+----------------------+
11 rows in set (0.00 sec)

mysql>
mysql> set global global_connection_memory_limit=2097152;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+---------------------------------------------------------------------+
| Level   | Code | Message                                                             |
+---------+------+---------------------------------------------------------------------+
| Warning | 1292 | Truncated incorrect global_connection_memory_limit value: '2097152' |
+---------+------+---------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> show global variables like '%mem%';
+---------------------------------------+----------------------+
| Variable_name                         | Value                |
+---------------------------------------+----------------------+
| connection_memory_chunk_size          | 8912                 |
| connection_memory_limit               | 18446744073709551615 |
| global_connection_memory_limit        | 16777216             |
| global_connection_memory_tracking     | ON                   |
| histogram_generation_max_mem_size     | 20000000             |
| internal_tmp_mem_storage_engine       | TempTable            |
| locked_in_memory                      | OFF                  |
| optimizer_trace_max_mem_size          | 1048576              |
| parser_max_mem_size                   | 18446744073709551615 |
| performance_schema_max_memory_classes | 450                  |
| range_optimizer_max_mem_size          | 8388608              |
+---------------------------------------+----------------------+
11 rows in set (0.00 sec)

How to repeat:
Consider to set global_connection_memory_limit to 2097152 (using SET GLOBAL) and it will be auto adjusted to 16777216
[1 Feb 2022 6:12] MySQL Verification Team
Hello Chelluru,

Thank you for the report and feedback.

regards,
Umesh
[1 Feb 2022 14:14] Jon Stephens
sys_vars.cc shows the minimum as 1024*1024*16.

8.0.29-git shows:

mysql> SELECT @@global_connection_memory_limit;
+----------------------------------+
| @@global_connection_memory_limit |
+----------------------------------+
|             18446744073709551615 |
+----------------------------------+
1 row in set (0.01 sec)

mysql> SET GLOBAL global_connection_memory_limit = 16777216;
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT @@global_connection_memory_limit;
+----------------------------------+
| @@global_connection_memory_limit |
+----------------------------------+
|                         16777216 |
+----------------------------------+
1 row in set (0.00 sec)
[1 Feb 2022 14:29] Jon Stephens
The minimum previously stated in the documentation was not accurate and has been corrected. The update will appear online shortly.

Thanks!

Closed.