# \[FATAL\] failed to allocate memory

**URL:** <https://www.ruby-forum.com/t/fatal-failed-to-allocate-memory/61246>\
**Category:** Rails\
**Created:** [May 22, 2006, 11:46am UTC](https://www.ruby-forum.com/t/fatal-failed-to-allocate-memory/61246 "2006-05-22T11:46:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![caiwangqin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4bbf92/32.png) [@caiwangqin](https://www.ruby-forum.com/u/caiwangqin)\
**Post date:** [May 22, 2006, 11:46am UTC](https://www.ruby-forum.com/t/fatal-failed-to-allocate-memory/61246/1 "2006-05-22T11:46:29Z")

</div>

hi,

i used odbc connect ms sqlserver on windows, it raise : [FATAL] failed  
to  
allocate memory when “select top 10 \* from tables”, the same app can run  
correct on Debian, how can i fix the error?

–  
Best Regards,

Caiwangqin  
[http://www.uuzone.com](http://www.uuzone.com)  
Mobile: +8613951787088  
Tel: +86025-84818086 ext 233  
Fax: +86025-84814993

---

<div class="post-metadata">

**Author:** ![caiwangqin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4bbf92/32.png) [@caiwangqin](https://www.ruby-forum.com/u/caiwangqin)\
**Post date:** [May 22, 2006, 10:42pm UTC](https://www.ruby-forum.com/t/fatal-failed-to-allocate-memory/61246/2 "2006-05-22T22:42:02Z")

</div>

A few ideas:

- your table name “tables” might be an issue; can you try changing it  
to something else?
- a “select top 10 …” query will consume a lot of memory; do you  
have enough memory (RAM and virtual) in your SQL Server box to run  
this request?
- “select top 10 \* …” doesn’t make it clear which criteria you’re  
using to find the “top” records; I’m not sure how SQL Server would  
handle this. Is it possible to reword this query?

Regards

Dave M.
