Tuesday 15 March 2011

64bit - Is there a 64-bit Ruby? -


It seems that people are compiling MRI Ruby (1.8.7) for 64-bit platforms. I have been searching and reading for a while, in fact without the answer I want, without it. What do I know if any of you actually used more than 4GB of memory in Ruby? Is Ruby really 64-bit if you compile it like this?

I have indicated that comments in source code have not been tested on 64-bit. For example, it says that "BigDiskm has not yet been compiled and tested on 64 bit integer systems."

It will also be interesting to know how to make other implementations in Ruby's 64-bits.

MRI (both 1.8.x and 1.9.x lines) can be compiled as 64 bits is. For example, Snow Leopard has been compiled as bundle with 1.8.7 as 64 bit. This activity can be viewed in the monitor, or by asking irb , for example 42.size . If you have been compiled in 64 bit, 4 (byte) otherwise, you will get 8 (bytes).

Ruby will be able to use more than 4g of mem. For example:

  $ irb> & Gt; N = (1 <29) & lt; + 8 = & gt; 536870 920 & gt; & Gt; X = Array.New (n, 42); X.size = & gt; 536870921 # bigger than one because it contains 0 to n inclusive elements  

If you do not exceed 4G or RAM then getting the last line will take some time because the OS will swap too much, but Even works with 4 GB on my machine. The size of the virtual RAM for this process was 4.02G.

I updated the comment to the large DCMML file which was outdated (from March 2003 ...)


No comments:

Post a Comment