The “System.OutOfMemory” error

Applies to
ApexSQL Diff, ApexSQL Log, ApexSQL Doc, ApexSQL Doc for MySQL

This article explains what to do when the System.OutOfMemory exception is encountered

This usually happens when working with large databases, backups, or script folders that contain a large number of objects

The exception is caused by the .NET Framework architecture and the way it allocates memory. Due to the nature of .NET Framework, this issue cannot be completely overcome, but there is a workaround

Use Command Line Interface (CLI) that the previously mentioned ApexSQL products contain. Using the CLI puts less strain on your resources. You can either save your project using the Graphical User Interface (GUI) and then execute it via the CLI, or you can specify all the parameters using the CLI entirely

To create your project using the GUI and execute it via the CLI:

  1. Make your project using the GUI and Save it
  2. Open Command Prompt
  3. Navigate to the ApexSQL product installation path
    (e.g. cd C:\ProgramFiles\ApexSQL\ApexSQLDiff\
    cd C:\ProgramFiles\ApexSQL\ApexSQLLog\)
  4. Type:
    1. for ApexSQL Diff
    2. /project:<project path>\lt&;project name>
      (e.g. /project:C\:Users\ApexUser\Documents\ApexSQL\ApexSQLDiff\project.axds)

      A synchronization file will be created in the ApexSQL Diff installation folder

    3. for ApexSQL Log
    4. /project:<project path>\<project name> /undo:<filename>
      (e.g. /project:C\:Users\ApexUser\Documents\ApexSQL\ApexSQLLog\project.axlp /undo:undoscript.sql)

      The script file named undoscript.sql will be created in the ApexSQL Log installation folder
      CLI in ApexSQL Log, you can output the results into a file and thus avoid showing them in the Main grid

    5. for ApexSQL Doc
    6. /<project path>\<project name>
      (e.g. /pr:D:\ApexSQLDoc2012\uptodate.axdp)

      The documentation will be created in the default output folder – the installation folder

About ApexSQL Log
ApexSQL Log is a SQL Server Transaction Log reader that allows viewing transaction log data in read-friendly format. Audit and undo SQL database changes of your choosing. Determine who changed the data and when the change had occurred. Read the transaction log to find out who created, changed or dropped a database object

Last updated
April 7, 2013