Skip to content

Implement Memory information capture from performance_schema on MySQL 5.7 #75

@PeterZaitsev

Description

@PeterZaitsev

Note this table only exists on MySQL 5.7 so graceful handling of its absence is recommended

mysql> select * from memory_summary_global_by_event_name where count_alloc>0 order by current_number_of_bytes_used desc limit 2 \G
*************************** 1. row ***************************
EVENT_NAME: memory/innodb/buf_buf_pool
COUNT_ALLOC: 192
COUNT_FREE: 0
SUM_NUMBER_OF_BYTES_ALLOC: 26398949376
SUM_NUMBER_OF_BYTES_FREE: 0
LOW_COUNT_USED: 0
CURRENT_COUNT_USED: 192
HIGH_COUNT_USED: 192
LOW_NUMBER_OF_BYTES_USED: 0
CURRENT_NUMBER_OF_BYTES_USED: 26398949376
HIGH_NUMBER_OF_BYTES_USED: 26398949376
*************************** 2. row ***************************
EVENT_NAME: memory/innodb/hash0hash
COUNT_ALLOC: 82
COUNT_FREE: 6
SUM_NUMBER_OF_BYTES_ALLOC: 1976975584
SUM_NUMBER_OF_BYTES_FREE: 1223839920
LOW_COUNT_USED: 0
CURRENT_COUNT_USED: 76
HIGH_COUNT_USED: 76
LOW_NUMBER_OF_BYTES_USED: 0
CURRENT_NUMBER_OF_BYTES_USED: 753135664
HIGH_NUMBER_OF_BYTES_USED: 1161079744
2 rows in set (0.01 sec)

There are a lot of columns here. I think most interesting are ones related to the memory usage not number of allocation calls:

CURRENT_NUMBER_OF_BYTES_USED: 753135664
HIGH_NUMBER_OF_BYTES_USED: 1161079744

Which correspond to current usage and highest usage ever. Former is helpful for catching high memory usage by stored procedures or other areas where allocation is done for short term.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions