# out of memoey when running query

**URL:** <https://forums.toadworld.com/t/out-of-memoey-when-running-query/6113>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [January 5, 2010, 10:53pm UTC](https://forums.toadworld.com/t/out-of-memoey-when-running-query/6113 "2010-01-05T22:53:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phillbat](https://avatars.discourse-cdn.com/v4/letter/p/8e7dd6/32.png) [@phillbat](https://forums.toadworld.com/u/phillbat)\
**Post date:** [January 5, 2010, 10:53pm UTC](https://forums.toadworld.com/t/out-of-memoey-when-running-query/6113/1 "2010-01-05T22:53:56Z")

</div>

Hi

When i try ro export some data from a table i receive the following error:

‘system.OutOfMemoryException’ was thrown. If I try to run this in Access in works fine.

The server is windows 2003 enterprise with 8Gb of RAM.

Is this an issue with Toad or does it physically run out of RAM? Why would this work in Access?

Any help much appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [January 6, 2010, 12:25am UTC](https://forums.toadworld.com/t/out-of-memoey-when-running-query/6113/2 "2010-01-06T00:25:41Z")

</div>

Each export type handled memory differently. Try exporting as Comma Separated values. I believe this is the most efficient.

Debbie

---

<div class="post-metadata">

**Author:** ![phillbat](https://avatars.discourse-cdn.com/v4/letter/p/8e7dd6/32.png) [@phillbat](https://forums.toadworld.com/u/phillbat)\
**Post date:** [January 6, 2010, 9:45pm UTC](https://forums.toadworld.com/t/out-of-memoey-when-running-query/6113/3 "2010-01-06T21:45:19Z")

</div>

hi debbie,

Thanks for the respone but i still receive an error when i use a csv file. It only does 1 million out of 2.2 million recoreds

I have also checked the performance of the server and the memory only rises to 25% before the crash.

I receive the following error  
Thanks

System.InvalidOperationException  
Failed to compare two elements in the array.  
Stack Trace:  
at System.Array.SorterObjectArray.QuickSort(Int32 left, Int32 right)  
at System.Array.Sort(Array keys, Array items, Int32 index, Int32 length, IComparer comparer)  
at System.Collections.ArrayList.Sort(Int32 index, Int32 count, IComparer comparer)  
at System.Collections.ArrayList.Sort(IComparer comparer)  
at DevExpress.XtraBars.MessageFilter.BarManagerMessageFilter.System.Windows.Forms.IMessageFilter.PreFilterMessage(Message& m)

```
System.OutOfMemoryException
Exception of type 'System.OutOfMemoryException' was thrown.
Stack Trace:
   at DevExpress.XtraBars.MessageFilter.BarManagerMessageFilter.ManagersComparer.System.Collections.IComparer.Compare(Object a, Object b)
   at System.Array.SorterObjectArray.QuickSort(Int32 left, Int32 right)

```

Message was edited by: phillbat
