# NoMemoryError

**URL:** <https://www.ruby-forum.com/t/nomemoryerror/94042>\
**Category:** Rails\
**Created:** [April 19, 2006, 12:05am UTC](https://www.ruby-forum.com/t/nomemoryerror/94042 "2006-04-19T00:05:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [April 19, 2006, 12:05am UTC](https://www.ruby-forum.com/t/nomemoryerror/94042/1 "2006-04-19T00:05:31Z")

</div>

I am using the Openbase adapter and have had a similar glitch here  
and there, but after I go into production I consistently get an error  
on one page.

ActionView::TemplateError (NoMemoryError: failed to allocate memory:  
SELECT \* FROM …

I cannot track down the exact location of the error, but the  
production log says it was around:  
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/  
active\_record/connection\_adapters/abstract\_adapter.rb:120:in `log' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/ active_record/connection_adapters/openbase_adapter.rb:152:in`execute’  
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/  
active\_record/connection\_adapters/openbase\_adapter.rb:222:in `select’

The development WEBrick spits this out occasionally:  
ruby(3306,0xa000ed98) malloc: \*\*\* error for object 0x219ab00: pointer  
being reallocated was not allocated  
ruby(3306,0xa000ed98) malloc: \*\*\* set a breakpoint in szone\_error to  
debug  
ruby(3306,0xa000ed98) malloc: \*\*\* error for object 0x219ab00: pointer  
being reallocated was not allocated  
ruby(3306,0xa000ed98) malloc: \*\*\* set a breakpoint in szone\_error to  
debug  
/usr/local/lib/ruby/1.8/yaml.rb:380: [BUG] Bus Error  
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]

Are these ruby glitches or something in the Openbase connection? Any  
tips on debugging this problem?

-John

–  
John S.  
Computing Staff - Webmaster  
Kavli Institute for Theoretical Physics  
University of California, Santa Barbara  
removed\_email\_address@domain.invalid  
(805) 893-6307

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [November 8, 2008, 5:03pm UTC](https://www.ruby-forum.com/t/nomemoryerror/94042/2 "2008-11-08T17:03:19Z")

</div>

John S. wrote:

> I am using the Openbase adapter and have had a similar glitch here  
> and there, but after I go into production I consistently get an error  
> on one page.
> 
> ActionView::TemplateError (NoMemoryError: failed to allocate memory:  
> SELECT \* FROM …
> 
> I cannot track down the exact location of the error, but the  
> production log says it was around:  
> /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/  
> active\_record/connection\_adapters/abstract\_adapter.rb:120:in `log' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/ active_record/connection_adapters/openbase_adapter.rb:152:in`execute’  
> /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/  
> active\_record/connection\_adapters/openbase\_adapter.rb:222:in `select’
> 
> The development WEBrick spits this out occasionally:  
> ruby(3306,0xa000ed98) malloc: \*\*\* error for object 0x219ab00: pointer  
> being reallocated was not allocated  
> ruby(3306,0xa000ed98) malloc: \*\*\* set a breakpoint in szone\_error to  
> debug  
> ruby(3306,0xa000ed98) malloc: \*\*\* error for object 0x219ab00: pointer  
> being reallocated was not allocated  
> ruby(3306,0xa000ed98) malloc: \*\*\* set a breakpoint in szone\_error to  
> debug  
> /usr/local/lib/ruby/1.8/yaml.rb:380: [BUG] Bus Error  
> ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]
> 
> Are these ruby glitches or something in the Openbase connection? Any  
> tips on debugging this problem?
> 
> -John
> 
> –  
> John S.  
> Computing Staff - Webmaster  
> Kavli Institute for Theoretical Physics  
> University of California, Santa Barbara  
> removed\_email\_address@domain.invalid  
> (805) 893-6307

John - I notice you had this issue a couple of years ago.  
Do you have any more experience with this problem now?

I had an app which I was close to completing. I ran my functional tests  
and the terminal window completely froze.  
Eventually I had to reboot.

After doing so I couldnt get the app to run again so I decided to take  
this oppourtunity to quickly rebuild the app. There were a couple of  
changes I wanted to make to the models, nothing major, just changing the  
max length of fields etc.

When I copied over the tests from the previous app to the new app and  
ran them  
I expected to see a few errors reflecting my changes but instead the  
whole app freezes. I can only run three or four tests at a time or I get  
this message:

ruby(3339) malloc: \*\*\* vm\_allocate(size=1069056) failed (error code=3)  
ruby(3339) malloc: \*\*\* error: can’t allocate region  
ruby(3339) malloc: \*\*\* set a breakpoint in szone\_error to debug  
ruby(3339) malloc: \*\*\* vm\_allocate(size=1069056) failed (error code=3)  
ruby(3339) malloc: \*\*\* error: can’t allocate region  
ruby(3339) malloc: \*\*\* set a breakpoint in szone\_error to debug  
ruby(3339) malloc: \*\*\* vm\_allocate(size=1069056) failed (error code=3)  
ruby(3339) malloc: \*\*\* error: can’t allocate region  
ruby(3339) malloc: \*\*\* set a breakpoint in szone\_error to debug  
ruby(3339) malloc: \*\*\* vm\_allocate(size=1069056) failed (error code=3)  
ruby(3339) malloc: \*\*\* error: can’t allocate region  
ruby(3339) malloc: \*\*\* set a breakpoint in szone\_error to debug  
[FATAL] failed to allocate memory  
rake aborted!  
Command failed with status (1): [/usr/local/bin/ruby -Ilib:test  
"/usr/local…]

Any ideas on where the problem could be?

thanks  
Gavin
