DEV Community

Recca Tsai
Recca Tsai

Posted on • Originally published at recca0120.github.io

Run Windows 10 on 1GB RAM: 5 PowerShell Optimizations

Originally published at recca0120.github.io

Running Windows 10 on a machine with only 1GB of RAM (e.g., a small AWS EC2 instance) means memory is maxed out right after boot. The following services can be disabled to reduce usage — run all commands in PowerShell as Administrator.

Memory Compression

Windows 10 compresses memory to save space, but the compression itself consumes CPU and memory. On small machines, disabling it actually improves performance.

# Disable
Disable-MMAgent -mc

# Enable
Enable-MMAgent -mc
Enter fullscreen mode Exit fullscreen mode

Superfetch (SysMain)

Superfetch preloads frequently used programs into memory. On memory-constrained machines, this does more harm than good.

# Disable
Stop-Service -Force -Name "SysMain"; Set-Service -Name "SysMain" -StartupType Disabled

# Enable
Stop-Service -Force -Name "SysMain"
Enter fullscreen mode Exit fullscreen mode

Windows Defender

Real-time protection continuously scans in the background, consuming significant memory and CPU. If you're in an isolated environment, consider disabling it.

# Disable
Set-MpPreference -DisableIntrusionPreventionSystem $true -DisableIOAVProtection $true -DisableRealtimeMonitoring $true -DisableScriptScanning $true -EnableControlledFolderAccess Disabled -EnableNetworkProtection AuditMode -Force -MAPSReporting Disabled -SubmitSamplesConsent NeverSend
Enter fullscreen mode Exit fullscreen mode

Windows Network Data Usage Monitor

This service tracks network traffic. Disabling it frees up a bit of memory.

# Disable
Set-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Services\Ndu\" -Name Start -Value 4

# Enable
Set-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Services\Ndu\" -Name Start -Value 2
Enter fullscreen mode Exit fullscreen mode

OneDrive

If you don't need cloud sync, hide OneDrive from File Explorer:

# Disable
$regkey1 = 'Registry::HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}'
$regkey2 = 'Registry::HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}'
Set-ItemProperty -Path $regkey1, $regkey2 -Name System.IsPinnedToNameSpaceTree -Value 0

# Enable
Set-ItemProperty -Path $regkey1, $regkey2 -Name System.IsPinnedToNameSpaceTree -Value 1
Enter fullscreen mode Exit fullscreen mode

After making all these adjustments and rebooting, memory usage should drop significantly.

Top comments (0)