简体   繁体   中英

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

在此处输入图片说明 .

Not sure why that happened "max memory of SQL server decreased automatically from 18024 MB to 1024 MB".

But if you want to correct it, you can do it instantly without restart :

1. Increase Max memory

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.

2. Determine current memory allocation

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)

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:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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