mysql 查看内存使用

1.

查看一个page_size 的大小  

mysql> show variables like '%page_s%';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| innodb_page_size | 16384 |
| large_page_size  | 0     |
+------------------+-------+
2 rows in set (0.00 sec)

 show engine innodb status\G
 

BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 8795455488
Dictionary memory allocated 7314135
Buffer pool size   524224
Free buffers       32775
Database pages     476701
Old database pages 175315
Modified db pages  89529

memory allocated   内存 单位bytes

Buffer pool size      buffer的页数  ,一个页的默认大小是16K

524224*16/1024.00=8191MB 

2.

SELECT @@innodb_buffer_pool_size/1024/1024/1024;

参考:

MySQL :: MySQL 8.0 Reference Manual :: 7.1.10 Server Status Variables 

MySQL :: MySQL 8.0 Reference Manual :: 17.8.3.1 Configuring InnoDB Buffer Pool Size

你可能感兴趣的:(mysql,mysql,数据库)