# NoMemoryError Oracle

**URL:** <https://www.ruby-forum.com/t/nomemoryerror-oracle/59130>\
**Category:** Rails\
**Created:** [April 28, 2006, 10:24pm UTC](https://www.ruby-forum.com/t/nomemoryerror-oracle/59130 "2006-04-28T22:24:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpitman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dpitman](https://www.ruby-forum.com/u/dpitman)\
**Post date:** [April 28, 2006, 10:24pm UTC](https://www.ruby-forum.com/t/nomemoryerror-oracle/59130/1 "2006-04-28T22:24:45Z")

</div>

Hello,

I’m trying to run rails on a Solaris 10 box with Ruby/OCI8, but I’m  
getting the following errors when trying to start up.

# script/server

=\> Booting WEBrick…  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/servers/  
webrick.rb:49:in `[]=': failed to allocate memory (NoMemoryError) from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ commands/servers/webrick.rb:49 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:21:in`require’  
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/  
lib/active\_support/dependencies.rb:147:in `require' from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ commands/server.rb:30 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:21:in`require’  
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/  
lib/active\_support/dependencies.rb:147:in `require’  
from script/server:3

# script/console

/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/console.rb:  
18:in `[]=': failed to allocate memory (NoMemoryError) from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ commands/console.rb:18 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:21:in`require’  
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/  
lib/active\_support/dependencies.rb:147:in `require’  
from script/console:3

I only get the error after installing Ruby/OCI8.

Rails 1.1.2  
Oracle Instant Client 10.2  
Ruby/OCI8 0.1.15

There is plenty of free memory on the system.

Any ideas?

Thanks,  
Dave

---

<div class="post-metadata">

**Author:** ![dpitman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dpitman](https://www.ruby-forum.com/u/dpitman)\
**Post date:** [April 29, 2006, 10:52am UTC](https://www.ruby-forum.com/t/nomemoryerror-oracle/59130/2 "2006-04-29T10:52:09Z")

</div>

Hi,

David P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> Hello,
> 
> I’m trying to run rails on a Solaris 10 box with Ruby/OCI8, but I’m  
> getting the following errors when trying to start up.
> 
> # script/server
> 
> =\> Booting WEBrick…  
> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/servers/  
> webrick.rb:49:in `[]=': failed to allocate memory (NoMemoryError)  
> from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/

webrick.rb:49: ENV[“RAILS\_ENV”] = OPTIONS[:environment]

> # script/console
> 
> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/console.rb:  
> 18:in `[]=': failed to allocate memory (NoMemoryError)  
> from /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/

console.rb:18: ENV[‘RAILS\_ENV’] = ARGV.first || ENV[‘RAILS\_ENV’] ||  
‘development’

> I only get the error after installing Ruby/OCI8.
> 
> Rails 1.1.2  
> Oracle Instant Client 10.2  
> Ruby/OCI8 0.1.15
> 
> There is plenty of free memory on the system.
> 
> Any ideas?

I can’t imagine why it occurs. But it may be caused by a change in  
0.1.15. How about reverting the change?

## vi ext/oci8/oci8.c

void  
Init\_oci8lib()  
{  
#ifndef \_WIN32 ← delete  
ruby\_setenv(“”, NULL); /\* duplicate environ vars \*/ ← delete  
#endif ← delete

## /\* Handle \*/ cOCIHandle = rb\_define\_class(“OCIHandle”, rb\_cObject);

If this is the cause, I must release 0.1.15.1.

–  
KUBO Takehiro  
email: removed\_email\_address@domain.invalid  
web: [http://www.jiubao.org](http://www.jiubao.org)  
GnuPG fingerprint = 5F7B C8EF CA16 57D0 FDE1 9F47 C001 1F93 AC08 2262

---

<div class="post-metadata">

**Author:** ![dpitman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dpitman](https://www.ruby-forum.com/u/dpitman)\
**Post date:** [August 3, 2006, 2:22pm UTC](https://www.ruby-forum.com/t/nomemoryerror-oracle/59130/3 "2006-08-03T14:22:08Z")

</div>

Thanks for your help!  
Adding the code to oci8.rb works.

-Dave

On Apr 30, 2006, at 7:37 AM, KUBO Takehiro wrote:

> (snip)
> 
> > > Any ideas?  
> > > ENV[‘ORA\_NLS10’] = “” if ENV[‘ORA\_NLS10’].nil?  
> > > GnuPG fingerprint = 5F7B C8EF CA16 57D0 FDE1 9F47 C001 1F93 AC08 2262
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
David P.  
Programmer/Analyst II  
Fox Chase Cancer Center

---

<div class="post-metadata">

**Author:** ![dpitman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9adbd/32.png) [@dpitman](https://www.ruby-forum.com/u/dpitman)\
**Post date:** [May 3, 2006, 7:11pm UTC](https://www.ruby-forum.com/t/nomemoryerror-oracle/59130/4 "2006-05-03T19:11:06Z")

</div>

Hi,

KUBO Takehiro [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> David P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:
> 
> > Hello,
> > 
> > I’m trying to run rails on a Solaris 10 box with Ruby/OCI8, but I’m  
> > getting the following errors when trying to start up.  
> > (snip)  
> > I only get the error after installing Ruby/OCI8.

I installed Solaris 10 x86 and I got the same error.

> > Rails 1.1.2  
> > Oracle Instant Client 10.2  
> > Ruby/OCI8 0.1.15
> > 
> > There is plenty of free memory on the system.
> > 
> > Any ideas?
> 
> I can’t imagine why it occurs. But it may be caused by a change in  
> 0.1.15. How about reverting the change?

No. It doesn’t solve.

Add the following code to the top of  
‘/usr/local/lib/ruby/site\_ruby/1.8/oci8.rb’

ENV[‘ORA\_NLS\_PROFILE33’] = “” if ENV[‘ORA\_NLS\_PROFILE33’].nil?  
ENV[‘ORA\_NLS10’] = “” if ENV[‘ORA\_NLS10’].nil?  
ENV[‘ORACLE\_HOME’] = “.” if ENV[‘ORACLE\_HOME’].nil?

Instant Client set these environment variables if they aren’t set.  
If the key name is a new one, it causes problem. So set the same key  
in advance.

–  
KUBO Takehiro  
email: removed\_email\_address@domain.invalid  
web: [http://www.jiubao.org](http://www.jiubao.org)  
GnuPG fingerprint = 5F7B C8EF CA16 57D0 FDE1 9F47 C001 1F93 AC08 2262
