|
# 1.使用下述语句查询各个模块的内存占用(查看当前哪个模块内存占用多)SELECT SUBSTRING_INDEX(event_name,'/',2) AS code_area, sys.format_bytes(SUM(current_alloc)) AS current_alloc FROM sys.x$memory_global_by_current_bytes GROUP BY SUBSTRING_INDEX(event_name,'/',2) ORDER BY SUM(current_alloc) DESC;select *from sys.x$memory_global_by_current_byteswhere event_name like "memory/sql/%" order by current_alloc desc;#2.查看具体哪个连接占用内存多select thread_id, event_name, SUM_NUMBER_OF_BYTES_ALLOC from performance_schema.memory_summary_by_thread_by_event_nameorder by SUM_NUMBER_OF_BYTES_ALLOC desc limit 20;#3.查看占用内存最多的连接的详细信息select * fromperformance_schema.threads where THREAD_ID = xxx;
|
|