Patches item #6437, was opened at 2006-11-01 10:56
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1700&aid=6437&group_id=426

Category: Ruby1.9
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Paul Brannan (cout)
Assigned to: Nobody (None)
Summary: reduce memory usage of rdoc

Initial Comment:
It has been reported ([ruby-core:8379], [ruby-talk:129432]) that rdoc uses quite a lot of memory when generating ri and html documentation for the ruby interpreter.  This is not as big a problem on ruby 1.8, since ri documentation is not generated by default.  This patch reduces the memory usage of rdoc from over 500MB to less than 80MB.  The generation process does not take significantly longer (close to 5 minutes both before and after the patch).  The script was validated to produce exactly the same output for html and ri both before and after the patch on the ruby source code, though there may be other software that is affected.

The patch primarily does three things:
  - Where Strings were allocated by the parser before, Symbols are now used.  This increases the size of the symbol table but reduces the total number of object allocations.
  - The Token class is now a Struct, since Structs use less memory to store their members than an equivalent class using instance variables.
  - Arrays that were allocated by default but given 0 members are now set to nil and only allocated as necessary


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1700&aid=6437&group_id=426