[MDEV-25250] performance schema shows negative amount of memory allocated for global_system_variables Created: 2021-03-25  Updated: 2021-03-25  Resolved: 2021-03-25

Status: Closed
Project: MariaDB Server
Component/s: Performance Schema
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Vladislav Vaintroub Assignee: Sergei Golubchik
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-23936 Wrong (negative) values in P_S memory... Open

 Description   

This test was on Windows, I did not try elsewhere.
After normal startup "mysqld --performance_schema=1", and login, negative amount of memory is allocated by global_system_variables

mysql> select * from performance_schema.memory_summary_by_thread_by_event_name where count_free > count_alloc\G
*************************** 1. row ***************************
                   THREAD_ID: 1
                  EVENT_NAME: memory/sql/global_system_variables
                 COUNT_ALLOC: 0
                  COUNT_FREE: 2
   SUM_NUMBER_OF_BYTES_ALLOC: 0
    SUM_NUMBER_OF_BYTES_FREE: 128
              LOW_COUNT_USED: -2
          CURRENT_COUNT_USED: -2
             HIGH_COUNT_USED: 0
    LOW_NUMBER_OF_BYTES_USED: -128
CURRENT_NUMBER_OF_BYTES_USED: -128
   HIGH_NUMBER_OF_BYTES_USED: 0
1 row in set (0.01 sec)

Also sys schema views are affected as result of it (sql/main below)

+-----------+----------------------------+--------------------+-------------------+-------------------+-------------------+-----------------+
| thread_id | user                       | current_count_used | current_allocated | current_avg_alloc | current_max_alloc | total_allocated |
+-----------+----------------------------+--------------------+-------------------+-------------------+-------------------+-----------------+
|         2 | mysys/statement_timer      |                  0 |                 0 |            0.0000 |                 0 |               0 |
|         6 | innodb/thread_pool_thread  |                  0 |                 0 |            0.0000 |                 0 |               0 |
|        10 | sql/manager                |                  0 |                 0 |            0.0000 |                 0 |               0 |
|        18 | root@localhost             |                  0 |                 0 |            0.0000 |                 0 |               0 |
|         5 | innodb/thread_pool_thread  |                  0 |                 0 |            0.0000 |                 0 |               0 |
|         9 | innodb/thread_pool_thread  |                  0 |                 0 |            0.0000 |                 0 |               0 |
|        17 | root@localhost             |                  0 |                 0 |            0.0000 |                 0 |               0 |
|         4 | innodb/page_cleaner_thread |                  0 |                 0 |            0.0000 |                 0 |               0 |
|         8 | innodb/thread_pool_thread  |                  0 |                 0 |            0.0000 |                 0 |               0 |
|        16 | root@localhost             |                  0 |                 0 |            0.0000 |                 0 |               0 |
|         3 | aria/checkpoint_background |                  0 |                 0 |            0.0000 |                 0 |               0 |
|         7 | innodb/thread_pool_thread  |                  0 |                 0 |            0.0000 |                 0 |               0 |
|        15 | root@localhost             |                  0 |                 0 |            0.0000 |                 0 |               0 |
|        19 | root@localhost             |                  0 |                 0 |            0.0000 |                 0 |               0 |
|         1 | sql/main                   |                 -2 |              -128 |           64.0000 |                 0 |               0 |
+-----------+----------------------------+--------------------+-------------------+-------------------+-------------------+-----------------+



 Comments   
Comment by Elena Stepanova [ 2021-03-25 ]

Looks much like MDEV-23936.

Comment by Vladislav Vaintroub [ 2021-03-25 ]

yes elenst,thanks!. that makes it a duplicate

Generated at Thu Feb 08 09:36:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.