Local Service system profile grown to extremely large size

Was doing some routine maintenance on my RDSH farm and noticed that one server has much less free space than the others.  I looked at which folders were the culprit and found this one:

C:\Windows\ServiceProfiles\LocalService\AppData\Local

It was full of files like the following:

FontCache-S-1-5-21-30371924-1664817342-1491421105-149182.dat

These files take up 50+GB of space.  My guess they're associated with user profiles.

Are they safe to delete?  I don't want to delete an actively used file.

February 11th, 2013 8:50am

Hi,   I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
Thank you for your understanding and support.
    Regards, Clarence TechNet Subscriber Support If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback here.
Free Windows Admin Tool Kit Click here and download it now
February 12th, 2013 4:41am

Any update on this?  I recently had to delete another 10GB from another server.
February 25th, 2013 9:42am

Found some info that this is because of the Presentation Font Cache service that's part of the .Net Framework.  Is there a setting somewhere that cleans it up?

Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2013 7:12pm

Hi,

This is a cache file for font, you can safely delete it.

April 5th, 2013 5:23am

Hi, I'd just like to expand a little on what Chris Cai said above. These FontCache-S-*.dat files are created by the Windows Font Cache service. I am the developer for that service, and can confirm what Chris said above. It is safe to delete these files. The service will simply recreate them as needed.

Just to confirm, the problem you're observing is with the sheer number of files, correct? In other words, the 50+ GB you mention must be the total size for all the files. In Windows 8 and 8.1 each file should be 8MB so to reach that total there must be thousands of these files.

As you've guessed, these files are per-user, so if many people log on to a server you could end up with many of these files. Unfortunately, the Font Cache service does not automatically delete old per-user cache files so for now I'm afraid you'll have to work around this on your own. For example, you could create a scheduled maintenance task that automatically deletes all the FontCache-S-*.dat files if their total size exceeds a certain amount. This is a safe workaround.

I'm investigating handling this kind of maintenance automatically in the next version of Windows AFTER 8.1. I'd be interested in any input that might help me decide on a reasonable clean-up policy. E.g., should it be strictly time-based or should there also be a cap on total disk usage? Do the servers in question tend to have just a few regular users and lots of infrequent or one-time users? A time-based policy might work well if that's the case. As far as space, what would you personally consider excessive and is this the sort of thing you'd want to be able to configure?

I hope this information is helpful, and thanks in advance for any input you may have.

Free Windows Admin Tool Kit Click here and download it now
August 30th, 2013 11:06pm

Why no supported solution until earliest in a later upcoming Windows version after 2012R2/8.1?

On TS/RDSH with a lot of users logging on, this is more or less just a waste of space when system disk is filled up with files not really necessary to be kept. I haven't timed it to confirm the CPU hog is caused by this, but I've read on forum/blog that the service sometimes takes alot of CPU resources. Why is it necessary to store this cache in local service profile instead of the individual user's profile?

I solved the cleanup workaround on our RDSH-farm by using forfiles in a scheduled task to delete FontCache files older than 30 days.

forfiles /P C:\Windows\ServiceProfiles\LocalService\AppData\Local /M FontCache* /D -30 /C "cmd /c del @path"
If there someday comes a supported cleanup feature, put the config in GPO and give the option to choose between age, amount of disk usage and how often cleanup shall be run.
September 26th, 2013 4:03pm

Niklas,

Your information was very helpful.  I am seeing this exact thing on my server.

My suggestion would be to tie the cleanup routine to the same function that deletes a user profile.  When the user profile is deleted, have it remove the font cache file for that user also. (I know of three ways to delete a user profile--through the system control panel, the delprof utility, and through a group policy setting that automatically deletes user profiles older than X number of days.  I use the third method on my servers.)

Also, I noticed on my servers that prior to 3/19/2013, the font cache files were usually relatively small (the majority are between 100 KB and 4 MB).  After 3/19/2013, they are all 8 MB, which means they are taking up much more disk space than they used to.  This is on a Windows 2008 R2 server.

Philip


  • Edited by Philip_2 Friday, January 03, 2014 9:04 PM
Free Windows Admin Tool Kit Click here and download it now
January 3rd, 2014 9:02pm

In a TS / RDS environment with hundreds of users generating profiles, this has become a significant issue for our environment. The scheduled task should take care of this, but it is something new to consider when building out a TS Farm. Our master image is 75GB, which used to be plenty. This new features storage requirements coupled with the number of potential connections (600 in our case) is not realistic. We have also considered disabling the Font Cache service all together, but we have some concerns about the impact on performance.

  • Edited by Gratefullee Thursday, January 23, 2014 3:34 PM Added comment
January 23rd, 2014 3:20pm

Thank you Niklas that is extremely helpful information.  Also great to see information direct from the developer!

We delete user profiles older than thirty days on our virtual servers (Citrix XenApp 6.5) to manage disk space.  I did not know this file was leftover, currently 23GB of them on one server.  It would be great if this file would go away with the user profile deletion.  

Free Windows Admin Tool Kit Click here and download it now
September 10th, 2014 12:22am

Is it safe to simply disable this service? (As others have mentioned, in a terminal services environment, the overhead is excessive)
April 3rd, 2015 1:47pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics