System.OutOfMemoryException
Published 16 July 2015
This error means there isn't enough free memory for SQL Source Control to work. It has several possible causes:
Management Studio is using too much memory
If Management Studio is using more than around 700MB-1GB of memory, this might be causing the problem. You can see how much memory Management Studio uses in Task Manager.
If you have Management Studio add-ins installed that you don't use (eg from Redgate's SQL Developer Bundle), uninstalling them may free memory.
The static data tables are too large
Source-controlling very large static data tables uses lots of memory, so we don't recommend it.
The database is too large
If the SQL created from the objects in your database is very long, this can cause the error. The long SQL might be created by having lots of long stored procedures; for example, stored procedures including long comment blocks.
You might need to restructure the database to make it smaller, or remove comment blocks from stored procedures.
There isn't enough space on disk
Redgate tools store temporary data in the %TMP% folder. By default, this folder is in your Windows profile folder (eg C:\Users\<username>\Temp). If you don't have much space on the hard drive, this folder might fill up and cause memory errors.
To fix this, Redgate tools can use a different hard drive. For example, to use the folder RGtemp on drive D:
- On the Start menu, right-click Computer and select Properties.
- In the Advanced tab, click Environment Variables.
- Click New.
- In the Variable name field, type: RGTEMP
- In the Variable value field, type: D:\RGtemp
- Click OK.
- Close Management Studio and any Redgate tools you have open.
- Log out of Windows and log in again.
Redgate tools will use the folder you specified to save temporary data. To test this, you can commit a change in SQL Source Control (or run an operation in another Redgate tool) and check that files are added to the new location.
To undo this and have Redgate tools use the default folder, delete the RGTEMP variable from the Environment Variables list and repeat steps 7 and 8.