Postgresql 中文操作指南
54.26. pg_shmem_allocations #
_pg_shmem_allocations_视图显示从服务器的主共享内存段分配的分配。这包括 PostgreSQL 本身分配的内存,以及使用 Section 38.10.10中详细机制的扩展分配的内存。
The pg_shmem_allocations view shows allocations made from the server’s main shared memory segment. This includes both memory allocated by PostgreSQL itself and memory allocated by extensions using the mechanisms detailed in Section 38.10.10.
注意,此视图不包括使用动态共享内存基础设施分配的内存。
Note that this view does not include memory allocated using the dynamic shared memory infrastructure.
Table 54.26. pg_shmem_allocations Columns
Table 54.26. pg_shmem_allocations Columns
Column Type Description |
name text The name of the shared memory allocation. NULL for unused memory and <anonymous> for anonymous allocations. |
off int8 The offset at which the allocation starts. NULL for anonymous allocations, since details related to them are not known. |
size int8 Size of the allocation in bytes |
allocated_size int8 Size of the allocation in bytes including padding. For anonymous allocations, no information about padding is available, so the size and allocated_size columns will always be equal. Padding is not meaningful for free memory, so the columns will be equal in that case also. |
匿名分配是使用 ShmemAlloc() 直接进行的,而不是通过 ShmemInitStruct() 或 ShmemInitHash() 进行的。
Anonymous allocations are allocations that have been made with ShmemAlloc() directly, rather than via ShmemInitStruct() or ShmemInitHash().
默认情况下,只有具有 pg_read_all_stats 角色权限的超级用户或角色才能读 pg_shmem_allocations 视图。
By default, the pg_shmem_allocations view can be read only by superusers or roles with privileges of the pg_read_all_stats role.