The “System.OutOfMemory” error

Applies to
ApexSQL Diff, ApexSQL Log, ApexSQL Doc

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

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

Cause
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

Resolution
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\
    or
    cd C:\ProgramFiles\ApexSQL\ApexSQLLog\)
  4. Type:
    1. for ApexSQL Diff
    2. ApexSQLDiff.com /project:<project path>\lt&;project name>
      (e.g. ApexSQLDiff.com /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. ApexSQLLog.com /project:<project path>\<project name> /undo:<filename>
      (e.g. ApexSQLLog.com /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. ApexSQLDoc.com /<project path>\<project name>
      (e.g. ApexSQLDoc.com /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