This topic describes the causes of and solutions to the issue that the available storage space on Drive C of a Windows Elastic Compute Service (ECS) instance is decreasing.
Problem description
The available storage space on Drive C of a Windows ECS instance is decreasing. As a result, the operating system cannot run as expected.
Causes and solutions
Cause 1: System logs may consume excessive storage space
When Windows Update installs updates, Deployment Image Servicing and Management (DISM) repairs system components, or operations that affect system files are performed, Windows stores the relevant log messages in log files located in the C:\Windows\Logs\CBS directory. If you do not clean up the log files at the earliest opportunity, the log files may consume excessive storage space on Drive C.
Solutions
Use the Windows built-in command-line tool DISM.exe to manage the WinSxS folder.
Run the following command at the command prompt to clean up the log files that you no longer require to free up disk storage space:
DISM.exe /Online /Cleanup-Image /SPSupersededManually delete the system log files.
ImportantBefore you manually delete the system log files, we recommend that you back up the files to prevent system instability or other issues that may occur due to improper deletion of files.
Cause 2: A large number of temporary files may be retained and may consume excessive storage space
In the Windows operating system, temporary files are created to temporarily store data while the operating system or applications are running. In most cases, the temporary files are stored in the C:\windows\temp or %USERPROFILE%\AppData\Local\Temp directory.
Solutions
Run a command to delete temporary files.
Run the following command at the command prompt to delete temporary files to free up disk storage space:
del /S /Q %TEMP%\*Manually delete temporary files.
Cause 3: Windows system updates may consume excessive storage space
When the operating system is updated or patches are installed, Windows downloads the update files of the new version to the C:\windows\WinSxS directory and creates a backup for the files of the old version. If you do not clean up the backup files of old versions or temporary files at the earliest opportunity, the files accumulate and consume excessive disk storage space.
Solutions
Do not manually delete files in the WinSxS folder, which may cause system instability issues or affect the performance of specific applications.
Use the Windows built-in command-line tool DISM.exe to manage the WinSxS folder.
Run the following command at the command prompt to clean up unnecessary files that are retained by Windows Update to free up disk storage space:
Dism.exe /online /cleanup-image /startcomponentcleanupUse the Windows built-in Disk Cleanup tool to clean up Drive C.
Cause 4: An amount of storage space on Drive C may be allocated as virtual memory
Virtual memory is an operating system technology used to supplement physical memory when the physical memory is insufficient. When the physical memory cannot meet the requirements of all running processes, the operating system transfers specific infrequently used data from the physical memory to the virtual memory. If the virtual memory is not properly configured, the operating system may be unable to run as expected. After you allocate an amount of storage space on Drive C as virtual memory, the storage space is deducted from the available storage space on Drive C. As a result, the total available storage space on Drive C decreases.
Solution
Check whether the virtual memory is properly configured. For information about how to configure the virtual memory, see How do I configure the virtual memory of a Windows instance?
Reference
You can use tools, such as WinDirStat and SpaceSniffer, to analyze the sizes of disk directories to identify disk directories that have large files and perform in-depth analysis on the files.