简体   繁体   English

SQL Server 最大内存自动减少

[英]SQL Server max memory decreased automatically

I have and machine powered by Windows Server 2012 R2 with SQL Server 2014, and for an unknown reason, the max memory of the SQL Server decreased automatically from 18024 MB to 1024 MB which is causing slowness in the system, as we need to update this value manually to 18024 MB我的机器由 Windows Server 2012 R2 和 SQL Server 2014 驱动,由于未知原因,SQL Server 的最大内存自动从 18024 MB 减少到 1024 MB,这导致系统运行缓慢,因为我们需要更新它手动设置为 18024 MB

在此处输入图片说明 . .

Not sure why that happened "max memory of SQL server decreased automatically from 18024 MB to 1024 MB".不知道为什么会发生“SQL 服务器的最大内存自动从 18024 MB 减少到 1024 MB”。

But if you want to correct it, you can do it instantly without restart :但是如果你想更正它,你可以立即完成而无需重新启动:

1. Increase Max memory 1.增加最大内存

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'max server memory', 18024;
GO
RECONFIGURE;
GO

Output will be like :输出将类似于:

Configuration option 'max server memory (MB)' changed from 1024 to 18024. Run the RECONFIGURE statement to install.配置选项“max server memory (MB)”从 1024 更改为 18024。运行 RECONFIGURE 语句进行安装。

2. Determine current memory allocation 2. 确定当前内存分配

SELECT 
  physical_memory_in_use_kb/1024 AS sql_physical_memory_in_use_MB, 
    large_page_allocations_kb/1024 AS sql_large_page_allocations_MB, 
    locked_page_allocations_kb/1024 AS sql_locked_page_allocations_MB,
    virtual_address_space_reserved_kb/1024 AS sql_VAS_reserved_MB, 
    virtual_address_space_committed_kb/1024 AS sql_VAS_committed_MB, 
    virtual_address_space_available_kb/1024 AS sql_VAS_available_MB,
    page_fault_count AS sql_page_fault_count,
    memory_utilization_percentage AS sql_memory_utilization_percentage, 
    process_physical_memory_low AS sql_process_physical_memory_low, 
    process_virtual_memory_low AS sql_process_virtual_memory_low
FROM sys.dm_os_process_memory;

3. Determining value for 'max server memory (MB) 3. 确定“最大服务器内存 (MB)”的值

SELECT c.value, c.value_in_use
FROM sys.configurations c WHERE c.[name] = 'max server memory (MB)'

For increasing memory from low doesn't require server restart/stop.从低增加内存不需要服务器重新启动/停止。 Just make sure your OS has enough memory for running self & other process to make sure everything runs ok after.只需确保您的操作系统有足够的内存来运行自己和其他进程,以确保之后一切正常。

For details refer Microsoft SQL server configuration options:有关详细信息,请参阅 Microsoft SQL 服务器配置选项:

https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/server-memory-server-configuration-options?view=sql-server-ver15 https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/server-memory-server-configuration-options?view=sql-server-ver15

As you said in your comments that this problem happens on weekends, there may be some management scripts on your server, which do some cleaning and configuration tasks.正如您在评论中所说,这个问题发生在周末,您的服务器上可能有一些管理脚本,它们会执行一些清理和配置任务。 Please check your SQL Server agent jobs and maintenance plans on the server.请检查服务器上的 SQL Server 代理作业和维护计划。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM