title: Exception 'System.OutOfMemoryException' was thrown
body: <p>We currently have a site on IIS where the outside can go on and make payments, and the payment goes through an API to a third party and payment can be seen there. We also have a database that is on a different server than the site.</p>
  
  <p>We have been getting an error "Exception of type 'System.OutOfMemoryException' was thrown" when payments try to come in and it seems to keep fixing by itself without us doing anything other than logging in to the server and sometimes restarting the server. For example, when customers try to make a transaction online, they will get this error sometimes. If they try again later, then it may go through successfully without error.</p>
  
  <p>Is anyone familiar with this error and know where to look or begin? </p>
  
  <p>Thank you</p>
  
  <pre><code>Exception of type 'System.OutOfMemoryException' was thrown. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
   Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
  
  Source Error: 
  
  
   An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
  
  Stack Trace: 
  
  
  
  [OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
    System.Runtime.CompilerServices.RuntimeHelpers._CompileMethod(IRuntimeMethodInfo method) +0
     System.Reflection.Emit.DynamicMethod.CreateDelegate(Type delegateType, Object target) +41
     System.Linq.Expressions.Expression`1.Compile() +187
     System.Data.Common.Internal.Materialization.Translator.Compile(Expression body) +154
  
  [TargetInvocationException: Exception has been thrown by the target of an invocation.]
     System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
     System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
     System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +211
     System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
     System.Data.Common.Internal.Materialization.Translator.Compile(Type resultType, Expression body) +237
     System.Data.Common.Internal.Materialization.ReplacementExpressionVisitor.Visit(Expression expression) +222
     System.Linq.Expressions.EntityExpressionVisitor.VisitExpressionList(ReadOnlyCollection`1 original) +155
     System.Linq.Expressions.E
  </code></pre>