onedrive

OneDrive High CPU Usage

Resolution Checklist

  • 1 Understand what causes high CPU usage in OneDrive
  • 2 Find and remove symbolic links or folder loops
  • 3 Optimize sync performance on Windows
  • 4 Optimize sync performance on macOS
  • 5 Manage large file libraries and telemetry
  • 6 Summary Checklist

OneDrive High CPU Usage

High CPU usage (often spiking to 100% on one or more processor cores) or excessive disk thrashing by OneDrive suggests that the sync engine has entered an infinite scanning loop. This is typically caused by database corruption, conflicts with security tools, or circular directories (folder loops).

This guide helps you identify the triggers of high CPU load and apply optimizations to restore normal system performance on Windows and macOS.


Understand what causes high CPU usage in OneDrive

OneDrive consumes excessive system resources due to specific file system and metadata anomalies:

  1. Circular Directory Loops: Symbolic links (symlinks) or junctions inside the OneDrive folder that point back to a parent directory, causing the crawler to loop infinitely.
  2. Library Size Limits: Exceeding the recommended soft limit of 300,000 files across all synced libraries, causing the database engine to run out of memory cache.
  3. Telemetry Logs Congestion: Logging processes write debug logs constantly, clogging disk I/O.
  4. Antivirus Scanning Collisions: Real-time antivirus protection scans files concurrently with OneDrive’s sync attempts, locking files and forcing OneDrive to restart its scanner continuously.

OneDrive does not support symbolic links or directory junctions. The sync engine will attempt to traverse them, often getting trapped in loops.

Open PowerShell and locate any links or junctions in your OneDrive directory:

Get-ChildItem -Path "$env:USERPROFILE\OneDrive" -Recurse -Force -ErrorAction SilentlyContinue | Where-Object { $_.LinkType -or $_.Attributes -match "ReparsePoint" } | Select-Object FullName, LinkType
  • Resolution: Delete the returned symlinks or move them out of your OneDrive folder structure.

Open Terminal and find symbolic links:

find ~/Library/CloudStorage/OneDrive-Personal -type l 2>/dev/null
  • Resolution: Remove the symlinks. If you require links, utilize standard macOS Aliases instead, which OneDrive handles as simple files.

Optimize sync performance on Windows

If OneDrive continues to consume high CPU resources on Windows, reset the database and configure folder exclusions.

1. Reset the Local Database

Purge the local sync state. This forces OneDrive to build a fresh, uncorrupted local index:

taskkill /f /im OneDrive.exe
%localappdata%\Microsoft\OneDrive\onedrive.exe /reset

2. Exclude OneDrive from Windows Defender Real-Time Scans

Warning: This reduces real-time file scanning for this process, but stops file locks. Ensure you only perform this if you have local admin credentials. Run this command in an Administrator PowerShell window:

Add-MpPreference -ExclusionProcess "OneDrive.exe"

3. Clear Stale Telemetry Logs

Delete telemetry files that can trigger write loops:

del /f /q /s "%localappdata%\Microsoft\OneDrive\setup\logs\*.otc" 2>nul
del /f /q /s "%localappdata%\Microsoft\OneDrive\setup\logs\*.otl" 2>nul

Optimize sync performance on macOS

On macOS, FileProvider crashes are a primary cause of CPU spikes.

1. Purge OneDrive Logs and Cache

Open Terminal and run the following command block to delete diagnostic reports and telemetry logs:

killall -9 OneDrive
rm -rf ~/Library/Logs/OneDrive/*
rm -rf ~/Library/Application\ Support/OneDrive/settings

2. Force Restart macOS FileProvider and Finder

killall -9 fileproviderd
killall Finder

3. Disable Finder Icon Badges

Calculating and drawing icon overlays on thousands of files consumes excessive CPU:

  1. Open macOS System Settings -> Extensions -> Finder Extensions.
  2. Deselect the checkbox for OneDrive Finder Integration.
  3. Relaunch OneDrive.

Manage large file libraries and telemetry

If you sync more than 300,000 files, the database index size causes high memory and CPU overhead.

  • Use selective sync: Uncheck folders that you do not need active access to on this PC/Mac.
  • Enable Files On-Demand: Change your sync files to “Online-Only” so OneDrive does not need to continuously monitor local file hashes.
    • Windows: Toggle on “Save space and download files as you use them” in settings.
    • macOS: Files On-Demand is enabled by default by the Apple FileProvider API.

Summary Checklist

Action ItemVerification MethodStatus
Audit Directory TreeRun PowerShell/Terminal scripts to identify and delete symlinks[ ]
Reset Sync IndexRun /reset command to rebuild the client database[ ]
Clear Telemetry LogsDelete .otc and .otl logs (Windows) or log folders (macOS)[ ]
Configure AntivirusAdd OneDrive.exe to antivirus process exclusion lists[ ]
Turn Off Finder OverlaysUncheck Finder Extensions for OneDrive on macOS if CPU remains high[ ]
Limit Library SizeKeep active sync count below the 300,000 file threshold[ ]