State Repository Service HIGH CPU Usage

After upgrading a HP system to Windows 11 24H2, Windows State Repository service was killing the CPU, I took a large number of steps which had no affect but I finally discovered what was causing my problem, See below for solution (I will make assumptions you are technical enough to not need every step explaining.

1) Check Systemdrive/Users

Step one is to show Hidden system / files and check the /users directory for any weird profiles, mine had around 50 Defaultuser10000/.XXX folders, I deleted all of these folders as none are useful.

2) Event Viewer DB Corruption check

Search your event viewer logs for something to this nature:

				
					DllHost (9020,D,50,0) WebPlatStorage: Database 'C:\Users\XXXXX\AppData\Local\Packages\Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy\AppData\CacheStorage\CacheStorage.edb': The primary index 'Primary' of table 'DatabaseProperties' for locale 'en-US' is out of date with sorting libraries, index sort version: (SortId=00000001-57ee-1e5c-00b4-d0000bb1e11e, Version=0006040300060403), current sort version: (SortId=00000001-57ee-1e5c-00b4-d0000bb1e11e, Version=0006050200060502). If used in this state (i.e. not rebuilt), it may appear corrupt or get further corrupted. If there is no later event showing the index being rebuilt, then please defragment the database to rebuild the index.
				
			

Now open CMD/Powershell and execute this line filling in the path as per your error above

				
					esentutl /d "C:\Users\XXXX\AppData\Local\Packages\Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy\AppData\CacheStorage\CacheStorage.edb"
				
			

Reboot the PC, Now login and give it 10 minutes to finish rebuilding the database and hopefully this will solve the problem for you. I would also recommend running Windows Repair ALL in one and repairing everything + rebuilding rephrase / env variables.

Clear Event Viewer

After this I normally Clear event viewer logs and reboot and then repeat the above with any new paths / errors that display.

Previous things which did not seem to fix the problem: 

  1. Repairing Windows Store
  2. Clear cache
  3. Repair edge
  4. Remove/reinstall all Appx (win store apps)
  5. Disable win search service
  6. Create another user
  7. System cleanup (inc sys files)

Get Support Now

Complete the form below to see if we can help

IT Consultation

A free, comprehensive IT consultation that lasts between 30 to 60 minutes. During this session, we’ll delve into understanding your unique IT needs and how we can address them. Our goal is to provide you with a clear general overview of your current IT setup and explore effective ways for improvement and implementation. Let us help you enhance your IT environment in a way that best supports your business.