内存属性Memory properties

适用于: SQL Server Analysis Services Azure Analysis Services Power BI Premium

Analysis Services 在启动时预先分配适度的内存量,以便可以立即处理请求。Analysis Services pre-allocates a modest amount of memory at startup so requests can be handled immediately. 可随着查询和处理工作负荷增加而分配更多内存。Additional memory is allocated as query and processing workloads increase. 通过指定配置设置,可以控制释放内存时的阈值。By specifying configuration settings, you can control the thresholds at which memory is released. 例如, HardMemoryLimit 设置指定自行强制实施的内存不足条件(默认情况下,此阈值未启用),在此条件下会彻底拒绝新请求,直到有更多资源可用。For example, the HardMemoryLimit setting specifies a self-imposed out-of-memory condition (by default, this threshold is not enabled), where new requests are rejected outright until more resources become available. 除非另有说明,否则以下设置适用于表格和多维服务器。The following settings apply to both tabular and multidimensional servers unless noted otherwise.

默认内存配置Default memory configuration

默认情况下,在启动时,每个实例分配少量 RAM (40 MB 到 50 MB) ,即使实例处于空闲状态也是如此。Under the default configuration, each instance allocates a small amount of RAM (40 MB to 50 MB) at startup, even if the instance is idle. 每个实例的配置设置。Configuration settings are per instance. 如果在同一硬件上运行多个实例(例如表格和多维实例),则每个实例都将独立于其他实例来分配自己的内存。If you are running multiple instances, such as a tabular and multidimensional instance on the same hardware, each instance will allocate its own memory independently of other instances.

设置Setting 描述Description
LowMemoryLimitLowMemoryLimit 对于多维实例,这是阈值下限,达到该阈值时,服务器首先开始释放分配给不常使用的对象的内存。For multidimensional instances, a lower threshold at which the server first begins releasing memory allocated to infrequently used objects.
VertiPaqMemoryLimitVertiPaqMemoryLimit 对于表格实例,这是阈值下限,达到该阈值时,服务器首先开始释放分配给不常使用的对象的内存。For tabular instances, a lower threshold at which the server first begins releasing memory allocated to infrequently used objects.
TotalMemoryLimitTotalMemoryLimit 这是阈值上限,达到该阈值时,Analysis Services 开始更积极地释放内存以便为正在执行的请求以及新的高优先级请求腾出空间。An upper threshold at which Analysis Services begins releasing memory more aggressively to make room for requests that are in execution as well as new high priority requests.
HardMemoryLimitHardMemoryLimit 这是另一个阈值,达到该阈值时,由于内存压力,Analysis Services 开始彻底拒绝请求。Another threshold at which Analysis Services begins rejecting requests outright due to memory pressure.

属性参考Property reference

除非另行指定,否则以下属性同时适用于表格和多维模式。The following properties apply to both tabular and multidimensional modes unless specified otherwise.

介于 1 和 100 之间的值表示 “物理总内存”“虚拟地址空间” 的百分比(以二者中少者计)。Values between 1 and 100 represent percentages of Total Physical Memory or Virtual Address Space, whichever is less. 超过 100 的值表示内存限制(以字节为单位)。Values over 100 represent memory limits in bytes.

LowMemoryLimitLowMemoryLimit
一个有符号的64位双精度浮点数属性,它定义第一个阈值,Analysis Services 开始为低优先级对象(如不常使用的缓存)释放内存。A signed 64-bit double-precision floating-point number property that defines the first threshold at which Analysis Services begins releasing memory for low-priority objects, such as an infrequently used cache. 一旦分配了内存,服务器便不会释放低于此限制的内存。Once the memory is allocated, the server does not release memory below this limit. 默认值为 65;这指示最低内存限制为物理内存或虚拟地址空间的 65%(以二者中少者计)。The default value is 65; which indicates the low memory limit is 65% of physical memory or the virtual address space, whichever is less.

TotalMemoryLimitTotalMemoryLimit
定义一个阈值,达到该阈值时,服务器会释放内存以便为其他请求腾出空间。Defines a threshold that when reached, causes the server to deallocate memory to make room for other requests. 达到此限制时,实例将通过关闭过期会话以及卸载未使用的计算从缓存中缓慢清除内存。When this limit is reached, the instance will start to slowly clear memory out of caches by closing expired sessions and unloading unused calculations. 对于 SQL Server Analysis Services,默认值为80% 的物理内存或虚拟地址空间,以两者中较小者为准。For SQL Server Analysis Services, The default value is 80% of physical memory or the virtual address space, whichever is less. Azure Analysis Services 的默认值基于您的计划,并且不可配置。The default value for Azure Analysis Services is based on your plan and isn't configurable. TotalMemoryLimit 必须始终小于 HardMemoryLimitTotalMemoryLimit must always be less than HardMemoryLimit.

HardMemoryLimitHardMemoryLimit
指定一个内存阈值,达到该阈值后实例会主动终止活动用户会话以减少内存的使用量。Specifies a memory threshold after which the instance aggressively terminates active user sessions to reduce memory usage. 所有终止的会话都将收到一个错误,该错误会因内存压力而被取消。All terminated sessions will receive an error about being canceled by memory pressure. 默认值为零 (0),这意味着 HardMemoryLimit 将设置为 TotalMemoryLimit 和系统的物理总内存之间的中间值;如果系统的物理内存大于进程的虚拟地址空间,则改用虚拟地址空间来计算 HardMemoryLimitThe default value, zero (0), means the HardMemoryLimit will be set to a midway value between TotalMemoryLimit and the total physical memory of the system; if the physical memory of the system is larger than the virtual address space of the process, then virtual address space will be used instead to calculate HardMemoryLimit. 此值无法配置 Azure Analysis Services。This value isn't configurable for Azure Analysis Services.

QueryMemoryLimit QueryMemoryLimit
仅适用于 Azure Analysis Services 和 SQL Server 2019 及更高版本。Applies to Azure Analysis Services and SQL Server 2019 and later only. 用于控制查询期间可以使用的内存量的高级属性。An advanced property to control how much memory can be used during a query.

在 SQL Server 2019 及更高版本中,此设置仅适用于在查询处理过程中创建中间 DAX 查询结果的内存线轴。In SQL Server 2019 and later, this setting applies only to memory spools where intermediate DAX query results are created during query processing. 它不适用于 MDX 查询。It does not apply to MDX queries. 在 Azure Analysis Services 中,此设置不限于内存线轴。In Azure Analysis Services, this setting is not limited only to memory spools. 它适用于 DAX 查询和 MDX 查询使用的所有内存。It applies to all memory utilized by both DAX and MDX queries.

指定百分比,百分比为100。Specified in percentage up to 100. 如果超过100,则以字节为单位。When more than 100, it's in bytes. 如果将值设置为0,则表示未指定限制。Setting a value of 0 means no limit is specified. 对于 Azure Analysis Services,默认值由你的计划决定。For Azure Analysis Services, the default value is determined by your plan.

计划Plan 默认Default
D1D1 8080
所有其他计划All other plans 2020

VirtualMemoryLimitVirtualMemoryLimit
这是一项高级属性,除非有 MicrosoftMicrosoft 技术支持的指导,否则不应更改此属性。An advanced property that you should not change, except under the guidance of MicrosoftMicrosoft support.

VertiPaqPagingPolicyVertiPaqPagingPolicy
仅针对表格实例,指定服务器内存不足时的分页行为。For tabular instances only, specifies the paging behavior in the event the server runs low on memory. 以下是有效值:Valid values are as follows:

设置Setting 描述Description
00 Azure Analysis Services 的 (默认值) 禁用分页。(default for Azure Analysis Services) Disables paging. 如果内存不足,处理将失败,同时显示内存不足错误。If memory is insufficient, processing fails with an out-of-memory error. 如果禁用分页,必须向服务帐户授予 Windows 特权。If you disable paging, you must grant Windows privileges to the service account. 有关说明,请参阅配置服务帐户 (Analysis Services)See Configure Service Accounts (Analysis Services) for instructions.
11 SQL Server Analysis Services 的 (默认值) 此属性支持使用操作系统页文件 ( # A0) 分页到磁盘。(default for SQL Server Analysis Services) This property enables paging to disk using the operating system page file (pagefile.sys).

设置为 1 时,处理不大可能由于内存限制而失败,因为服务器将尝试使用指定的方法对磁盘进行分页。When set to 1, processing is less likely to fail due to memory constraints because the server will try to page to disk using the method that you specified. 设置 VertiPaqPagingPolicy 属性并不会确保内存错误永远不会发生。Setting the VertiPaqPagingPolicy property does not guarantee that memory errors will never happen. 在下列条件下仍然可能会发生内存不足错误:Out of memory errors can still occur under the following conditions:

  • 没有足够的内存来用于所有字典。There is not enough memory for all dictionaries. 在处理过程中,服务器会锁定内存中每一列的字典,并且所有这些列的值不能超过为 VertiPaqMemoryLimit指定的值。During processing, the server locks the dictionaries for each column in memory, and all of these together cannot be more than the value specified for VertiPaqMemoryLimit.

  • 没有足够的虚拟地址空间来容纳这个过程。There is insufficient virtual address space to accommodate the process.

为了解决永久性的内存不足错误,您可以尝试重新设计模型以便减少需要处理的数据量,或者可以向计算机添加更多的物理内存。To resolve persistent out of memory errors, you can either try to redesign the model to reduce the amount of data that needs processing, or you can add more physical memory to the computer.

VertiPaqMemoryLimitVertiPaqMemoryLimit
仅针对表格实例,如果允许对磁盘进行分页,此属性指定内存占用达到何种程度(表示为内存总量的百分比)才开始分页。For tabular instances only, if paging to disk is allowed, this property specifies the level of memory consumption (as a percentage of total memory) at which paging starts. 默认值为 60。The default is 60. 如果内存占用不超过 60%,则服务器不会分页到磁盘。If memory consumption is less than 60 percent, the server will not page to disk. 此属性依赖于 VertiPaqPagingPolicyProperty,该属性必须设置为 1 才能进行分页。This property depends on the VertiPaqPagingPolicyProperty, which must be set to 1 in order for paging to occur.

HighMemoryPriceHighMemoryPrice
这是一项高级属性,除非有 MicrosoftMicrosoft 技术支持的指导,否则不应更改此属性。An advanced property that you should not change, except under the guidance of MicrosoftMicrosoft support.

MemoryHeapTypeMemoryHeapType
这是一项高级属性,除非有 MicrosoftMicrosoft 技术支持的指导,否则不应更改此属性。An advanced property that you should not change, except under the guidance of MicrosoftMicrosoft support. SQL Server 2016 SP1 及更高版本的 Analysis Services 中的有效值如下所示:Valid values in SQL Server 2016 SP1 and later Analysis Services are as follows:

设置Setting 说明Description
-1-1 (默认)Automatic。(default) Automatic. 该引擎将决定具体使用哪一个。The engine will decide which one to use.
11 Analysis Services HEAP。Analysis Services HEAP.
22 Windows LFH。Windows LFH.
55 混合分配器。Hybrid allocator. 此分配器将使用 Windows LFH 进行 <= 16 KB allocations and the AS Heap for > 16 KB 分配。This allocator will use Windows LFH for <= 16 KB allocations and the AS Heap for >16 KB allocations.
66 Intel TBB 分配器。Intel TBB allocator. 在 SQL Server 2016 SP1(及更高版本)的 Analysis Services 中可用。Available in SQL Server 2016 SP1 (and later) Analysis Services.

HeapTypeForObjectsHeapTypeForObjects
这是一项高级属性,除非有 MicrosoftMicrosoft 技术支持的指导,否则不应更改此属性。An advanced property that you should not change, except under the guidance of MicrosoftMicrosoft support. 以下是有效值:Valid values are as follows:

设置Setting 说明Description
-1-1 (默认)Automatic。(default) Automatic. 该引擎将决定具体使用哪一个。The engine will decide which one to use.
00 Windows LFH 堆。Windows LFH heap.
11 Analysis Services 槽分配器。Analysis Services slot allocator.
33 每个对象都有其自己的 Analysis Services 堆。Each object has its own Analysis Services Heap.

DefaultPagesCountToReuseDefaultPagesCountToReuse
这是一项高级属性,除非有 MicrosoftMicrosoft 技术支持的指导,否则不应更改此属性。An advanced property that you should not change, except under the guidance of MicrosoftMicrosoft support.

HandleIA64AlignmentFaultsHandleIA64AlignmentFaults
这是一项高级属性,除非有 MicrosoftMicrosoft 技术支持的指导,否则不应更改此属性。An advanced property that you should not change, except under the guidance of MicrosoftMicrosoft support.

MidMemoryPriceMidMemoryPrice
这是一项高级属性,除非有 MicrosoftMicrosoft 技术支持的指导,否则不应更改此属性。An advanced property that you should not change, except under the guidance of MicrosoftMicrosoft support.

MinimumAllocatedMemoryMinimumAllocatedMemory
这是一项高级属性,除非有 MicrosoftMicrosoft 技术支持的指导,否则不应更改此属性。An advanced property that you should not change, except under the guidance of MicrosoftMicrosoft support.

PreAllocatePreAllocate
这是一项高级属性,除非有 MicrosoftMicrosoft 技术支持的指导,否则不应更改此属性。An advanced property that you should not change, except under the guidance of MicrosoftMicrosoft support.

SessionMemoryLimitSessionMemoryLimit
这是一项高级属性,除非有 MicrosoftMicrosoft 技术支持的指导,否则不应更改此属性。An advanced property that you should not change, except under the guidance of MicrosoftMicrosoft support.

WaitCountIfHighMemoryWaitCountIfHighMemory
这是一项高级属性,除非有 MicrosoftMicrosoft 技术支持的指导,否则不应更改此属性。An advanced property that you should not change, except under the guidance of MicrosoftMicrosoft support.

请参阅See also

Analysis Services 中的服务器属性 Server properties in Analysis Services
确定 Analysis Services 实例的服务器模式Determine the Server Mode of an Analysis Services Instance