For ‘Out of Memory’ errors, it could be your system is truly hitting its memory limits i.e. querying / manipulating large amounts of data (loading several million rows). For these instances, an Out of Memory error can occur regardless of your RAM size. Also, if the error not reproducible on demand OR if it happens randomly, this can also indicate that a valid system out of memory event has occurred.
Please try the following and see if this will resolve or lessen the Out of Memory issue:
A)
Reboot your PC and try again. In many cases, a simple PC reboot fixes ‘Out of Memory’ errors.
B)
If you anticipate working on large amounts of data, reboot your PC first. Next try not to open your usual programs yet and/or close programs that automatically open. This way you are minimizing usage on your PC resources.
C)
If your Antivirus program is currently performing a system scan, wait for that to finish or cancel it before you start your large data intensive jobs.
D)
Modify your query or split your query into different runs i.e. 1 million rows at a time instead of several millions rows in one run. If your tables have hundreds of columns, BLOB / CLOB, or 4 gb size columns, then the example numbers above would be much lower i.e. 1/10/100 thousand rows at a time.
E)
Increase your Windows Virtual Memory size:
Windows 7:
Right-click My Computer | Properties | click ‘Advanced System Settings’ on the left | Advanced tab | under ‘Performance’ section, click ‘Settings’ button | Advanced tab again | under ‘Virtual Memory’ section, click the ‘Change’ button | un-check “Automatically manage paging file size…” | the C: drive usually has the paging file | choose ‘Custom Size:’ | change the ‘Initial Size’ and ‘Maximum size’ to a much higher number i.e. 18787 and 29987 or times 3 or more of the ‘Currently Allocated:’ size | click the ‘Set’ button | OK | Apply | OK | reboot PC.