Fixing Driver Locked Memory Issues in Windows and SQL Server RAM Recommendations - ZirveSunucum Information
Login
Customer Panel
Login
Register

Fixing Driver Locked Memory Issues in Windows and SQL Server RAM Recommendations

Fixing Driver Locked Memory Issues in Windows and SQL Server RAM Recommendations

Hello,

In Windows 10/11 or current products/services like Windows Server 2022, even if there is no memory leak issue in any hardware drivers, when checked with Rammap, the Driver Locked area sometimes shows that 90% or sometimes 50% of the system’s RAM is being used, meaning a large portion of RAM appears occupied. It took us some time to detect this issue, but it turned out to be related to the Windows operating system. Of course, this situation can be multi-dimensional and caused by different factors. If you encounter the issue caused by the operating system, we have listed the steps you need to take to fix it.
 

If you are not creating a virtual machine via HYPER-V in Windows and you don’t need Hyper-V, you can apply the code below to completely disable it, then restart your server to resolve the issue. You can run this code in PowerShell as administrator, or in CMD.

Code Example
bcdedit /set hypervisorlaunchtype off

 

As additional information, if your hardware is insufficient or you want higher performance, below we provide a code that disables some features and optimizes Edge. Please review its content and decide whether it is suitable for you. These codes are not mandatory; they remove certain features. To apply, create a file named run.ps1 on your desktop, paste the code inside, then run the ps1 file as administrator.

Code Example
# Remove Windows Defender (if you have external protection or the risk is acceptable for you)
# PowerShell 2.0 (old and creates security vulnerabilities)
# Remove SMB file sharing
# Remove printing services
# Remote Assistance (NOT RDP, safe to remove)

# Removes unnecessary features in order, deletes SMB protocol, removes printers
Uninstall-WindowsFeature Windows-Defender, PowerShell-V2, FS-SMB1, Print-Services, Remote-Assistance

# Registry settings to prevent Edge from running at startup and in the background
# First create the Edge folder (key)
$edgePath = "HKLM:\SOFTWARE\Policies\Microsoft\Edge"
if (!(Test-Path $edgePath)) {
    New-Item -Path $edgePath -Force
}
# Now apply the settings
Set-ItemProperty -Path $edgePath -Name 'HubsEnabled' -Value 0
Set-ItemProperty -Path $edgePath -Name 'StartupBoostEnabled' -Value 0

We also have some recommendations regarding SQL Server.

SQL Server RAM Setting Recommendations

To optimize SQL Server performance, it is critical to correctly configure the max server memory setting. The following recommendations show how to adjust RAM depending on different usage scenarios.

Usage Scenario Recommended Maximum RAM Setting
Heavy SQL usage (OLTP/OLAP, complex queries) 50% of physical RAM
Simple operations (small database, light queries) 30% of physical RAM
If the server is dedicated only to SQL Physical RAM – 5 GB

Explanations

  • Heavy usage: SQL Server requires more RAM for buffer cache and query execution. Therefore, half of the total RAM can be allocated.
  • Simple usage: For light queries, allocating too much RAM is unnecessary; 30% is sufficient.
  • Dedicated SQL Server: If the server is dedicated solely to SQL, leaving 5 GB for the operating system and services and assigning the rest to SQL is the most efficient method.

Implementation Example


EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'max server memory', 28000; -- For example, on 32 GB RAM, 28 GB is allocated to SQL
RECONFIGURE;

Note: These values are recommended for typical usage scenarios. You may need to adjust depending on other services running on your server and workload type.

Best regards.