数据库版本:Server version: 8.0.32-26 GreatSQL (GPL), Release 26, 操作系统:UnionTech OS Server 20 top截图: free -g输出: total used free shared buff/cache available Mem: 125 76 0 35 48 12 Swap: 3 3 0 my.cnf里面有关于内存的配置参数: key_buffer_size = 4096M max_allowed_packet = 512M read_rnd_buffer_size = 32M thread_cache_size = 300 innodb_buffer_pool_size = 20G max_heap_table_size = 256M join_buffer_size = 16M tmp_table_size = 256M table_open_cache = 2048 bulk_insert_buffer_size = 64M read_buffer_size = 16M sort_buffer_size = 16M net_buffer_length = 8K myisam_sort_buffer_size = 8M max_connections = 8000 上面的innodb_buffer_pool_size才20G,其他零零散散加起来应该也不会到70G吧? 我查了下下面的语句: 全局总内存25G左右: mysql> select * from sys.memory_global_total; +-----------------+ | total_allocated | +-----------------+ | 25.37 GiB | +-----------------+ 1 row in set (0.01 sec) 会话内存: mysql> select thd_id,conn_id, current_memory from sys.session where current_memory like '%M%' order by 3; +----------+----------+----------------+ | thd_id | conn_id | current_memory | +----------+----------+----------------+ | 72690195 | 61473587 | 1.21 MiB | | 72712200 | 61493864 | 1.25 MiB | | 72709387 | 61491275 | 1.31 MiB | | 72718318 | 61499534 | 1.31 MiB | | 72715663 | 61497071 | 1.35 MiB | | 72706233 | 61488401 | 1.46 MiB | | 72710791 | 61492583 | 1.48 MiB | | 72627503 | 61415759 | 1.53 MiB | | 72716667 | 61498011 | 1.58 MiB | | 72716664 | 61498008 | 1.80 MiB | | 72672172 | 61456876 | 1.91 MiB | | 72641324 | 61428492 | 1.97 MiB | | 72717818 | 61499066 | 17.34 MiB | | 72693278 | 61476446 | 18.19 MiB | | 72716495 | 61497847 | 2.05 MiB | | 72704410 | 61486714 | 2.07 MiB | | 56 | 5 | 2.14 MiB | | 72696072 | 61479016 | 4.10 MiB | | 72712192 | 61493856 | 4.16 MiB | | 72704420 | 61486716 | 5.80 MiB | | 72684324 | 61468196 | 6.51 MiB | | 72683907 | 61467811 | 7.46 MiB | +----------+----------+--- +----------+----------+----------------+ 22 rows in set (0.27 sec) 过滤的kib的,kib的200多个,没有gb的连接 这样算起来也没有达到70G吧,那是什么消耗了内存呢? 有没有大佬解解惑? |
yejr
2025-8-13 09:57:14
| ||
wrh
2025-8-13 10:08:12
| ||
yejr
2025-8-13 11:01:22
| ||
wrh
2025-8-13 11:17:31
| ||
yejr
2025-8-13 12:15:23
| ||
wrh
2025-8-13 12:28:28
| ||
yejr
2025-8-13 12:35:29
| ||
yejr
2025-8-13 14:23:51
| ||
wrh
2025-8-13 15:48:09
| ||
合作电话:010-64087828
社区邮箱:greatsql@greatdb.com