Error - Out of Memory Issues (System. OutOfMemoryException)

Modified on Thu, 18 Jan at 10:28 PM





There are two reasons why you might see an System.OutOfMemoryException (OOM) condition. 

  1. Your process is using a lot of memory (typically over 800MB in a 32-bit environment.) 
  2. The virtual address space is fragmented, reducing the likelihood that a large, contiguous allocation will succeed. 



NOTE: It's also possible to see an OOM condition due to a combination of 1 and 2. 


When an OOM occurs, you may notice one or more of the following symptoms. 

  • LawMaster crashes. 
  • LawMaster may experience high memory as indicated by Task Manager or Performance Monitor. 
  • Requests/Searches may take a long time to process. 
  • Users may report an error message in LawMaster due to the OOM. 



Causes: 


When it comes to determining the cause for an OOM condition, you are actually working to determine the cause for either a high memory situation or a fragmented address space. While there is no way to document all of the possible causes of these situations, there are some common causes that we see regularly. 

  • Returning Large Sets of Data
    When retrieving data from LawMaster, it’s important to limit the amount of data returned using the Max Records for example. Trying to return all folios when the max records is set at 10000 for example is a common way to create a high memory situation.
  • SQL Server with Pending Updates
    We have noticed that a Pending update and server waiting to reboot can caused the OOM error to appear 



Resolution 

  • Returning Large Sets of Data
    Always limit the amount of data that can be returned from a database. If you have set the max records to 10000 or a similar large value, try to reduce the number to a lesser value or use advanced filter to narrow down your query results.
  • Restart LawMaster Application Service:
    We have seen the Application Service use more memory when someone does a particularly large query. However, this matter doesn't seem to be always an issue. But would certainly be affected if someone did a large query.
    Usually these have been tracked most of the times to the UDQ's that users have run. If you are able to find out what everyone was running about the time the issue appeared, it would be helpful in locating the issue.
    Stopping and re-starting the LawMaster Application Service that is using the memory would normally being everything back to normal operation again. Although it does still kick everyone off. 
  • SQL Server with Pending Updates: Reboot the server and keep the server upto date with all the critical server updates recommendation from Microsoft. 



Additionally 


If this is an error that is reoccurring at your firm and if you are hosting your own database, we would request you to enable windows logs to capture memory utilization on the server and PC in question when consumption exceeds 90% or more as the logs will help is ascertaining the memory intensive application and further evaluation. 


If the database is hosted on the LawMaster Cloud, assist us with the below responses to have the issue further analysed 

  • What user was doing at the time of error 
  • Are they any other application that were opened 
  • Does the error appear to one user or all the user or did the error occur to all the user at once 
  • Has the user done a system reboot, and the does the error occur after the reboot 
  • Use the "Copy to Clipboard" option on the error to send us the detailed exception as that would assist to know the complete stack trace

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article