0
votes

We have a web application which goes down with an exception of type System.OutOfMemoryException. We are looking into root cause to fix.

Until then we are performing application pool recycle every week so that this incident does not occur.

Does recycling app pool every week cause any more complications for the website?

1

1 Answers

1
votes

In the web.config of your Sitecore site you can set the MemoryMonitorHook to clear some memory:

<hooks>
  <hook type="Sitecore.Diagnostics.MemoryMonitorHook, Sitecore.Kernel">
    <param desc="Threshold">800MB</param>
    <param desc="Check interval">00:05:00</param>
    <param desc="Minimum time between log entries">00:01:00</param>
    <ClearCaches>true</ClearCaches>
    <GarbageCollect>true</GarbageCollect>
    <AdjustLoadFactor>true</AdjustLoadFactor>
  </hook>
</hooks>

This basically tells Sitecore to start clearing caches and call the GC when the memory usage is over 800MB.
That way you don't have to manually recycle the app pool.

If it's not the Sitecore site you're worried about consuming too much memory and you have to recycle the app pool because of other applications, it's hard to tell if there's complications. We recycle the app pools as well once a week, we get no resulting issues. Obviously, we are doing it out of business hours and peak time.
If other applications are consuming too much memory, you could try getting them in a different app pool so you won't disturb the website?