sys.dm_os_memory_brokers (Transact-SQL)sys.dm_os_memory_brokers (Transact-SQL)

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions)

SQL ServerSQL Server 的内部分配使用 SQL ServerSQL Server 内存管理器。Allocations that are internal to SQL ServerSQL Server use the SQL ServerSQL Server memory manager. 跟踪来自 sys.dm_os_process_memory 和内部计数器的进程内存计数器之间的差异可以指示内存空间中的外部组件的内存使用情况 SQL ServerSQL ServerTracking the difference between process memory counters from sys.dm_os_process_memory and internal counters can indicate memory use from external components in the SQL ServerSQL Server memory space.

内存中介器基于当前使用量和预测的使用量来公平地在 SQL ServerSQL Server 内的各种组件之间分布内存分配。Memory brokers fairly distribute memory allocations between various components within SQL ServerSQL Server, based on current and projected usage. 内存中介器不执行分配。Memory brokers do not perform allocations. 它们只跟踪内存分配以计算分布情况。They only track allocations for computing distribution.

下表提供了有关内存中介器的信息。The following table provides information about memory brokers.

备注

若要从或调用此 Azure Synapse AnalyticsAzure Synapse Analytics 并行数据仓库Parallel Data Warehouse ,请使用名称 sys.dm_pdw_nodes_os_memory_brokersTo call this from Azure Synapse AnalyticsAzure Synapse Analytics or 并行数据仓库Parallel Data Warehouse, use the name sys.dm_pdw_nodes_os_memory_brokers.

列名称Column name 数据类型Data type 说明Description
pool_idpool_id intint 在资源池与资源调控器池相关联的情况下的资源池 ID。ID of the resource pool if it is associated with a Resource Governor pool.
memory_broker_typememory_broker_type nvarchar(60)nvarchar(60) 内存中介器的类型。Type of memory broker. 当前在中有三种类型的内存代理 SQL ServerSQL Server ,其说明如下所示。There are currently three types of memory brokers in SQL ServerSQL Server, listed below with their descriptions.

MEMORYBROKER_FOR_CACHE :分配用于缓存对象的内存 (缓冲池缓存) 。MEMORYBROKER_FOR_CACHE : Memory that is allocated for use by cached objects (Not Buffer Pool cache).

MEMORYBROKER_FOR_STEAL :从缓冲池盗用的内存。MEMORYBROKER_FOR_STEAL : Memory that is stolen from the buffer pool. 这种内存在当前所有者释放它之前,不能供其他组件重新使用。This memory is not available for reuse by other components until it is freed by the current owner.

MEMORYBROKER_FOR_RESERVE :保留供当前正在执行的请求使用的内存。MEMORYBROKER_FOR_RESERVE : Memory reserved for future use by currently executing requests.
allocations_kballocations_kb bigintbigint 已分配给这种类型的中介器的内存量(以 KB 为单位)。Amount of memory, in kilobytes (KB), that has been allocated to this type of broker.
allocations_kb_per_secallocations_kb_per_sec bigintbigint 每秒钟的内存分配速率(以 KB 为单位)。Rate of memory allocations in kilobytes (KB) per second. 对于内存释放,该值可以为负值。This value can be negative for memory deallocations.
predicted_allocations_kbpredicted_allocations_kb bigintbigint 由中介器预测的已分配的内存量。Predicted amount of allocated memory by the broker. 这基于内存使用模式。This is based on the memory usage pattern.
target_allocations_kbtarget_allocations_kb bigintbigint 基于当前设置和内存使用模式而建议分配的内存量(以 KB 为单位)。Recommended amount of allocated memory, in kilobytes (KB), that is based on current settings and the memory usage pattern. 该中介器应增长或缩减到此数目。This broker should grow to or shrink to this number.
future_allocations_kbfuture_allocations_kb bigintbigint 将在随后几秒内完成的预计分配量(以 KB 为单位)。Projected number of allocations, in kilobytes (KB), that will be done in the next several seconds.
overall_limit_kboverall_limit_kb bigintbigint 代理可分配的最大内存量(kb (KB) )。Maximum amount of memory, in kilobytes (KB), that the broker can allocate.
last_notificationlast_notification nvarchar(60)nvarchar(60) 基于当前设置和使用模式的内存使用建议。Memory usage recommendation that is based on the current settings and usage pattern. 以下是有效值:Valid values are as follows:

增长grow

缩减shrink

稳定版stable
pdw_node_idpdw_node_id intint 适用 于: Azure Synapse AnalyticsAzure Synapse Analytics并行数据仓库Parallel Data WarehouseApplies to: Azure Synapse AnalyticsAzure Synapse Analytics, 并行数据仓库Parallel Data Warehouse

此分发所在的节点的标识符。The identifier for the node that this distribution is on.

权限Permissions

在上 SQL ServerSQL Server ,需要 VIEW SERVER STATE 权限。On SQL ServerSQL Server, requires VIEW SERVER STATE permission.
在 SQL 数据库的基本、S0 和 S1 服务目标上,对于弹性池中的数据库, 服务器管理员 帐户或 Azure Active Directory 管理员 帐户是必需的。On SQL Database Basic, S0, and S1 service objectives, and for databases in elastic pools, the server admin account or the Azure Active Directory admin account is required. 对于所有其他 SQL 数据库服务目标, VIEW DATABASE STATE 数据库中需要该权限。On all other SQL Database service objectives, the VIEW DATABASE STATE permission is required in the database.

另请参阅See Also

(Transact-sql 的与操作系统相关的动态管理视图 SQL Server)SQL Server Operating System Related Dynamic Management Views (Transact-SQL)