# NoMemoryError ActiveSupportMultibyte - Normalize

**URL:** <https://www.ruby-forum.com/t/nomemoryerror-activesupportmultibyte-normalize/107230>\
**Category:** Rails\
**Created:** [June 19, 2007, 12:44pm UTC](https://www.ruby-forum.com/t/nomemoryerror-activesupportmultibyte-normalize/107230 "2007-06-19T12:44:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e480ec/32.png) [@mikel](https://www.ruby-forum.com/u/mikel)\
**Post date:** [June 19, 2007, 12:44pm UTC](https://www.ruby-forum.com/t/nomemoryerror-activesupportmultibyte-normalize/107230/1 "2007-06-19T12:44:14Z")

</div>

Hello all,

I am importing large word documents. I have a test file which is 30mb  
in length. I run this through a series of processes to clean it up  
and extract the data i need to inject bits of it into a database.

The 30mb file runs fine on my Mac. But on the FreeBSD server dies  
with a NoMemoryError at one of the first steps, which is normalizing  
the file.

Basically, the sequence is the user clicks import, this calls  
MiddleMan and starts a backgrounDRB task to import the file. The file  
is scanned through using Hpricot to get an idea on size and then is  
sent to normalize to sanitze the Unicode data.

The ruby process running this is at about 500mb at this point…

And at this point it crashes out with the stack trace attached. Any  
ideas? As I said, working without flaw on my MacBookPro. Also, the  
process works 100% OK on a file that is about 3-4mb.

Document 10, worker job\_key 1182240116-VMS10 = Book import started at  
Tue Jun 19 18:01:56 +1000 2007.  
failed to allocate memory - (NoMemoryError)  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/  
active\_support/multibyte/handlers/utf8\_handler.rb:299:in `unpack' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/multibyte/handlers/utf8_handler.rb:299:in`u\_unpack’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/  
active\_support/multibyte/handlers/utf8\_handler.rb:207:in `normalize' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/multibyte/chars.rb:81:in`send’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/  
active\_support/multibyte/chars.rb:81:in `method_missing' /data/rails/universal_translator/releases/20070619100151/config/../ script/backgroundrb/../../config/../lib/extractor.rb:22:in`character\_and\_paragraph\_styles\_from\_word’  
/data/rails/universal\_translator/releases/20070619100151/config/…/  
script/backgroundrb/…/…/config/…/lib/workers/book\_import\_worker.rb:  
53:in `do_work' /data/rails/universal_translator/releases/20070619100151/config/../ script/backgroundrb/../../config/../vendor/plugins/backgroundrb/ backgroundrb_rails.rb:36:in`start\_process’  
/data/rails/universal\_translator/releases/20070619100151/config/…/  
script/backgroundrb/…/…/config/…/vendor/plugins/backgroundrb/  
backgroundrb\_rails.rb:32:in `initialize' /data/rails/universal_translator/releases/20070619100151/config/../ script/backgroundrb/../../config/../vendor/plugins/backgroundrb/ backgroundrb_rails.rb:32:in`new’  
/data/rails/universal\_translator/releases/20070619100151/config/…/  
script/backgroundrb/…/…/config/…/vendor/plugins/backgroundrb/  
backgroundrb\_rails.rb:32:in `start_process' /data/rails/universal_translator/releases/20070619100151/config/../ script/backgroundrb/../../config/../vendor/plugins/backgroundrb/ backgroundrb.rb:57:in`new\_worker’  
/data/rails/universal\_translator/releases/20070619100151/config/…/  
script/backgroundrb/…/…/config/…/vendor/plugins/backgroundrb/  
backgroundrb.rb:49:in `synchronize' /data/rails/universal_translator/releases/20070619100151/config/../ script/backgroundrb/../../config/../vendor/plugins/backgroundrb/ backgroundrb.rb:49:in`new\_worker’  
/usr/local/lib/ruby/1.8/drb/drb.rb:1555:in ` __send__' /usr/local/lib/ruby/1.8/drb/drb.rb:1555:in`perform\_without\_block’  
/usr/local/lib/ruby/1.8/drb/drb.rb:1515:in `perform' /usr/local/lib/ruby/1.8/drb/drb.rb:1589:in`main\_loop’  
/usr/local/lib/ruby/1.8/drb/drb.rb:1585:in `loop' /usr/local/lib/ruby/1.8/drb/drb.rb:1585:in`main\_loop’  
/usr/local/lib/ruby/1.8/drb/drb.rb:1581:in `start' /usr/local/lib/ruby/1.8/drb/drb.rb:1581:in`main\_loop’  
/usr/local/lib/ruby/1.8/drb/drb.rb:1430:in `run' /usr/local/lib/ruby/1.8/drb/drb.rb:1427:in`start’  
/usr/local/lib/ruby/1.8/drb/drb.rb:1427:in `run' /usr/local/lib/ruby/1.8/drb/drb.rb:1347:in`initialize’  
/usr/local/lib/ruby/1.8/drb/drb.rb:1627:in `new' /usr/local/lib/ruby/1.8/drb/drb.rb:1627:in`start\_service’  
/data/rails/universal\_translator/releases/20070619100151/config/…/  
script/backgroundrb/start:98  
/data/rails/universal\_translator/releases/20070619100151/config/…/  
script/backgroundrb/start:94:in `fork' /data/rails/universal_translator/releases/20070619100151/config/../ script/backgroundrb/start:94 /data/rails/universal_translator/releases/20070619100151/config/../ script/backgroundrb/start:86:in`fork’  
/data/rails/universal\_translator/releases/20070619100151/config/…/  
script/backgroundrb/start:86
