# CD Stack filling up Temp files

We have SDL Web 8 Content Delivery Services (Deployer and Content Micro Services) installed on a Windows 2012 server. Today we noticed over 50Gb of files in the C:\Windows\Temp folder which are in sub folders with names like tomcat.4399394087417898973.8084. These in turn have the following folder structure:

"C:\Windows\Temp\tomcat.4399394087417898973.8084\work\Tomcat\localhost\ROOT"


Inside that folder we see a lot of .tmp files. It seems like the deployer or storage classes may be creating these files (maybe instead of the old transactions folders in the deployer?), but they don't seem to get cleaned up.

So my question is two-fold 1) What is making these files, and should they be automatically cleaned up? 2) Can I use a script to clean them up, and if so what criteria should I use for deciding if each .tmp file is deleted?

• We've got the same thing - automatically cleaning them up seemed to break the deployer. We have an open case with SDL support. – Rob Stevenson-Leggett Nov 23 '16 at 13:00
• Rob Stevenson-Leggett - did you ever get a response from support on this? – Chris Summers Feb 28 '17 at 13:06
• Hi Chris, See Tom's answer below - he's my colleague and we were working on this issue together. – Rob Stevenson-Leggett Feb 28 '17 at 16:22
• Yeah, I had seen that. Also moved my temp files, but it is becoming quite problematic. We are publishing a lot this week, and I get about 10Gb of temp files building up an hour :( Restarting the deployer does not help ion my case. I am also talking to support. – Chris Summers Feb 28 '17 at 16:24
• Hi Chris - Tom has added some info below. Looks like a restart is required during a quiet time periodically... – Rob Stevenson-Leggett Mar 1 '17 at 11:01

Hotfix CD_8.1.1.3643 should resolve this issue (both file system and database deployments).
It is also possible to add the line below to the application.properties file located in the config folder and change where the files are written.

server.tomcat.basedir=C:/SDLDelivery/tomcat-temp


So with this change, the tmp files will be written to the specified folder instead of the windows temp folder.

I found that a scheduled restart of the deployer service clears out the .tmp files but keeps the items it needs to work. Clearing out the folder completely stops the deployer from working until a restart is made.

You can also move the temporary tomcat folder to another drive by adding the "-Djava.io.tmpdir=D:\temp" to the installservice.ps1 and start.ps1 \$jvmoptions.

Hope this helps. Tom

EDIT - Top solution was quite temperamental so came up with the below.. (obviously change your dir to match your environment)

net stop SDLWebDeployerService
RMDIR D:\temp /S /Q
MD D:\temp
net start SDLWebDeployerService

Thanks, Tom

As an alternative to Tom's script, I ended up doing it with Powershell as follows:

Stop-Service -displayname "SDL Web Deployer Service"
Remove-Item "S:\SDL Web\Temp\Deployer\*.*" -recurse
Start-Service -displayname "SDL Web Deployer Service"


And call it as a Scheduled Task with

Powershell -file "S:\SDL Web\SCRIPTS\restart_deployer.ps1"


Hopefully we will get a more robust fix from SDL soon.

• Same issue we are also getting, do you have any timeline for this fix, we have been migrated lot of clients to SDL Web8.1.1 – Velmurugan Mar 14 '17 at 5:02
• Nice work Chris. At the time I didn't even think about PS Script as I quickly wanted this re-mediated for our client. Cheers – Tom Simm May 19 '17 at 14:55