Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 08 Mar 2019 02:51 PM by  Walter Boyd
Windows\Temp filling up
 10 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Walter Boyd



New Member


Posts:
New Member


--
27 Nov 2018 04:37 PM

    It seems like every time a task runs, some RazorEngine Temp files are created in my c:\windows\Temp folder. I just deleted 70k folders from windows it was filling up my server. Any ideas how to fix this?

    0

    J T



    Basic Member


    Posts:386
    Basic Member


    --
    04 Dec 2018 09:50 PM

    Hi Walter

    RazorEngine is used by many 3rd party apps and DNN. Is this a RazorEngine running from the Revindex Task Scheduler? How long has it been since these tasks ran to have accumulated that many folders (i.e months, days)? If it's a scheduled task, how often do you run that task?

    0

    Walter Boyd



    New Member


    Posts:
    New Member


    --
    07 Dec 2018 05:34 PM

    JT, as far as I know, this is my only module using the razor engine. A new temp file is created every 2 minutes, which fits as I have a task that runs every 2 minutes. And when I try to delete the files a vast majority are locked. Maybe it's something in the script?

    0

    Walter Boyd



    New Member


    Posts:
    New Member


    --
    08 Dec 2018 08:30 PM

    FYI, I confirmed it's not something in the script. I made a script that did nothing, temp files are still building up, and remain locked. Windows server 2016 btw.

    -Walter

    0

    J T



    Basic Member


    Posts:386
    Basic Member


    --
    13 Dec 2018 03:21 AM

    I ran the Task Scheduler locally and while it created the temp folder, it didn't create a new one each time it ran. Each task will create a new temp folder. Is your task somehow being changed each time? I assume you only got that one task?

    0

    Walter Boyd



    New Member


    Posts:
    New Member


    --
    13 Dec 2018 03:30 AM

    All the code code is static, it doesn't change. I have about 10 active tasks, but most run daily or weekly - only one runs every few minutes. It makes more sense that only one temp folder would appear, the script shouldn't need to be recompiled every time. Do you know what triggers the module to recompile?

    0

    J T



    Basic Member


    Posts:386
    Basic Member


    --
    13 Dec 2018 03:40 AM

    Exactly, it should only create one folder to prevent recompilation. I found some discussions here here here where some folks notice the files get locked by the process (in your case that would be the IIS web process) and couldn't delete the files. If you run it slower like every 10 minutes, does it still create the folders? Have you tried restarting IIS?

    0

    Walter Boyd



    New Member


    Posts:
    New Member


    --
    13 Dec 2018 03:56 AM

    I found those posts as well, not sure it's related. In your test was the folder getting deleted and rebuilt each time? Or was the same DLL being reused each time the script ran? Something is causing my system to recompile the code each time.

    0

    J T



    Basic Member


    Posts:386
    Basic Member


    --
    13 Dec 2018 04:01 AM

    The code explicitly checks to see if a precompiled cached version exists and won't compile again. On my system, it doesn't create multiple folders on subsequent scheduled runs of the same code.

    0

    Robert Axford



    New Member


    Posts:58
    New Member


    --
    08 Mar 2019 07:01 AM

    FYI - Just had a look in my temp folder and there seems to be a new razor folder roughly every day. Among the files inside is always a cs file that appears to be from the Revindex task scheduler as it contains the code from the task that I have on the server for Xero updates. I have that running once per day, so that fits.

    Each of the folders has it's own unique name e..g. RazorEngine_5k3op2gq.icw

    So yes, I can confirm I'm also seeing folders there, and if the task ran more frequently or on more portals, then there'd also be more folders.

    It's certainly not cleaning up after itself.
    Rob

    0

    Walter Boyd



    New Member


    Posts:
    New Member


    --
    08 Mar 2019 02:51 PM

    This still happens for me too; a new folder every 5 minutes. I never found a solution for this issue. I'm concerned about wasted resources, as the script DLL is locked - meaning something is maintaining an open file and probably using up memory. Also it's a waste of processing and memory as the script is being recompiled every time. I've had to schedule an automatic recycle of my website every night, and go manually clean up these folders every few weeks.

    -Walter

    0
    You are not authorized to post a reply.