NoMemoryError Oracle


#1

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:inrequire’
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:inrequire’
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:inrequire’
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


#2

Hi,

David P. 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
GnuPG fingerprint = 5F7B C8EF CA16 57D0 FDE1 9F47 C001 1F93 AC08 2262


#3

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


David P.
Programmer/Analyst II
Fox Chase Cancer Center


#4

Hi,

KUBO Takehiro removed_email_address@domain.invalid writes:

David P. 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
GnuPG fingerprint = 5F7B C8EF CA16 57D0 FDE1 9F47 C001 1F93 AC08 2262