SCCM - Too high Cache Size

Sokoban 1,041 Reputation points
2023-07-01T09:54:22.44+00:00

Screenshot 2023-06-30 at 13.11.37

Hi

I have problem with several clients is to high SCCM Cache size , over 60 GB. I have that settings see above .

What is missing ? something I have forgot ?

Sokoban

Microsoft Configuration Manager
0 comments No comments
{count} votes

Accepted answer
  1. Youssef Saad 3,421 Reputation points
    2023-07-03T10:12:51.7366667+00:00

    Hello Sokoban,

    You can try with the following script and deploy it as a configuration item or baseline:

    $now = Get-Date
    $writeTime = $now.AddDays(-21)
    $CMObject = New-Object -ComObject "UIResource.UIResourceMgr"
    $CMCacheObjects = $CMObject.GetCacheInfo()
    $CMCacheElements = $CMCacheObjects.GetCacheElements()
    $CMCacheElements | Where {$_.LastReferenceTime -le $writeTime} | ForEach-Object {$CMCacheObjects.DeleteCacheElement($_.CacheElementID)}
    $FilePath = "C:\Windows\ccmcache"
    Get-ChildItem -Path $FilePath -recurse | Where {($_.LastAccessTime -le $writeTime) -and ($_.PSISContainer) -eq $false} | Remove-Item -Recurse -Force
    do {
    	$CountDir = Get-ChildItem -path $FilePath -recurse | Where {($_.LastAccessTime -le $writeTime) -and ($_.PSISContainer -eq $true) -and ($_ | Get-ChildItem).Count -eq 0}
    	$CountDir | Remove-Item -Recurse -Force
    	$i++
    	} While (($i -lt 100) -and ($CountDir.count -gt 0))
    

    This will delete all content older than 21 days.

    Regards,

    Youssef Saad | Blog: https://youssef-saad.blogspot.com/ | LinkedIn

    2 people found this answer helpful.

5 additional answers

Sort by: Most helpful
  1. Youssef Saad 3,421 Reputation points
    2023-07-02T08:51:44.1966667+00:00

    Hello Sokoban,

    From your console, if you go to the device then check the applied client settings, do you have the same config?

    User's image

    Does the 20% percent aligned with the 60Gb consumed?

    Regards,

    Youssef Saad | Blog: https://youssef-saad.blogspot.com/ | LinkedIn

    1 person found this answer helpful.

  2. Youssef Saad 3,421 Reputation points
    2023-07-02T11:02:08.47+00:00

    Do you have this behavior on multiple machines? Does the ConfigMgr client version up-to-date?

    Try the following PS command on one affected machine and check the result:

    powershell -command "Get-WmiObject -Namespace ROOT\CCM\SoftMgmtAgent -Query 'Select Size from CacheConfig'"
    

    Regards,

    Youssef Saad | Blog: https://youssef-saad.blogspot.com/ | LinkedIn


  3. AllenLiu-MSFT 47,166 Reputation points Microsoft Vendor
    2023-07-03T02:47:14.6333333+00:00

    Hi, @Sokoban

    Thank you for posting in Microsoft Q&A forum.

    We may try to adjust the size of the client cache by using the cache size settings available in Client Settings in the Configuration Manager console.

    And check if the new client setting will overwrite the client cache size for the several clients.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".

    0 comments No comments

  4. Sokoban 1,041 Reputation points
    2023-07-03T07:56:19.5166667+00:00

    I have still the problem, over 60 GB size in ccmcache

    Scenario:

    • CB 2211 with hotfix Rollup (KB16643863)
    • The client have the latest client version 5.00.9096.1024
    • Resultant Client Settings show:

    Maximum cache size (MB) 20120

    Maximum cache size (percentage of disk) 20

    Minimum duration before the client can remove cached content (Minutes) 1440

    What can I do , maybe is a bug ?

    What is the Client Settings do ? Warning or Clean-Up ?

    Sokoban


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.