GBase 8a系统内存使用信息元数据表HEAP_USAGE_INFO和MEMORY_USAGE_INFO

GBase 8a提供了系统内存使用信息的元数据表,其中HEAP_USAGE_INFO是内部几个堆内存的使用情况,包括dc,large和temp,MEMORY_USAGE_INFO表则是该系欸但内存整体概况,包括峰值和出现峰值的时间等。同时当前session连接的内存使用信息可以通过SESSION_MEMORY_USAGE_INFO查看。

该功能,需要打开数据库统计内存功能才可看到数据。 GBase 8a集群统计运行期内存使用情况_gbase_session_memory_stat参数

系统堆内存信息 HEAP_USAGE_INFO

说明

列名类型说明
HOSTvarchar(64)主机名(本机)
HEAP_TYPEvarchar(16)堆类型(dc_heap,temp_heap,large_heap)
HEAP_SIZEbigint(16)堆总大小,单位字节
USED_IN_HEAPbigint(16)堆使用中的大小,单位字节
USED_IN_SYSTEMbigint(16)从操作系统额外申请的大小,单位字节
MAX_USED_BLOCKbigint(16)当前堆中,最大块的大小,单位字节
MAX_FREE_BLOCKbigint(16)当前堆中,最大可用块的大小,单位字节
USED_BLOCKSbigint(16)堆中使用的块个数(申请成功的次数)

样例

gbase> select * from  heap_usage_info;
+-------+------------+------------+--------------+----------------+----------------+----------------+-------------+
| HOST  | HEAP_TYPE  | HEAP_SIZE  | USED_IN_HEAP | USED_IN_SYSTEM | MAX_USED_BLOCK | MAX_FREE_BLOCK | USED_BLOCKS |
+-------+------------+------------+--------------+----------------+----------------+----------------+-------------+
| rh6-2 | dc_heap    | 1557135360 |      1032192 |              0 |        1032192 |     1556066304 |           8 |
| rh6-2 | temp_heap  |  268435456 |       141920 |              0 |         412256 |      268001280 |          12 |
| rh6-2 | large_heap |  778043392 |            0 |              0 |             64 |      778039296 |           0 |
+-------+------------+------------+--------------+----------------+----------------+----------------+-------------+
3 rows in set (Elapsed: 00:00:00.00)

系统内存概况 MEMORY_USAGE_INF

说明

列名类型说明
HOSTvarchar(64)主机名
PHSICAL_MEMORYbigint(16)物理内存大小,单位字节
SWAP_SIZEbigint(16)SWAP大小,单位字节
PCTvarchar(16)pct内存上限设定参数
UPPER_LIMITbigint(16)内存上限大小
CURRENT_USEDbigint(16)内存当前使用量,单位字节
MEMORY_PEAKbigint(16)内存使用峰值,单位字节
MEMORY_PEAK_TIMESTAMPdatetime内存峰值时的时间
GBase 8a数据库元数据表 系统内存概况 MEMORY_USAGE_INF

样例

gbase> select * from MEMORY_USAGE_INFO;
+---------------+----------------+------------+-----+-------------+--------------+-------------+-----------------------+
| HOST          | PHSICAL_MEMORY | SWAP_SIZE  | PCT | UPPER_LIMIT | CURRENT_USED | MEMORY_PEAK | MEMORY_PEAK_TIMESTAMP |
+---------------+----------------+------------+-----+-------------+--------------+-------------+-----------------------+
| gbase_rh7_001 |     3974889472 | 4294963200 | 80% |  6615882137 |      3623336 |     5513664 | 2021-05-12 09:55:14   |
+---------------+----------------+------------+-----+-------------+--------------+-------------+-----------------------+
1 row in set (Elapsed: 00:00:00.00)

gbase> select * from MEMORY_USAGE_INFO\G
*************************** 1. row ***************************
                 HOST: gbase_rh7_001
       PHSICAL_MEMORY: 3974889472
            SWAP_SIZE: 4294963200
                  PCT: 80%
          UPPER_LIMIT: 6615882137
         CURRENT_USED: 3623336
          MEMORY_PEAK: 5513664
MEMORY_PEAK_TIMESTAMP: 2021-05-12 09:55:14
1 row in set (Elapsed: 00:00:00.00)

SESSION级当前连接使用概况SESSION_MEMORY_USAGE_INFO

说明

列名类型说明
HOSTvarchar(64)主机名字
IDbigint(8)SESSION的ID号
CURRENTbigint(16)当前使用的总量,单位字节
PEAKbigint(16)峰值使用总量,单位字节
PEAK_TIMESTAMPdatetime峰值使用时间
TEMP_SPACEbigint(16)临时空间使用总量,单位字节
GBase 8a 数据库集群 SESSION级当前连接使用概况SESSION_MEMORY_USAGE_INFO

样例

gbase> select * from SESSION_MEMORY_USAGE_INFO;
+-------+----+---------+---------+---------------------+------------+
| HOST  | ID | CURRENT | PEAK    | PEAK_TIMESTAMP      | TEMP_SPACE |
+-------+----+---------+---------+---------------------+------------+
| rh6-2 |  9 |   17708 | 1430090 | 2021-05-11 13:45:06 |          0 |
+-------+----+---------+---------+---------------------+------------+
1 row in set (Elapsed: 00:00:00.00)