Max of an array?

what is the maximum size of elements can a ruby array hold and ‘process’
comfortably for a 1GB RAM machine?

Sorry if this sounds obvious

George G. [email protected] writes:

what is the maximum size of elements can a ruby array hold and ‘process’
comfortably for a 1GB RAM machine?

When you say, “maximum size of elements”, are you referring to the
size of the individual elements of the array, or the number of items
in the array? Obviously, the larger the elements, the fewer the count
for a given amount of memory.

It would be helpful to elaborate on ‘process’ also. If your processing
is compute intensive, then that could be as much of a bottleneck as
available memory.

If I would have to take a guess, he refers to the “number of items
in the array”.

Like, for 1 GIG of RAM, how large would it be, or asked in another way
if there is an automatical way to find this out for any amount of gig.

On Jun 25, 2009, at 10:24 AM, George G. wrote:

what is the maximum size of elements can a ruby array hold and
‘process’
comfortably for a 1GB RAM machine?

The 1GB real memory constraint doesn’t really help in answering the
question. The virtual memory size of a process can be much larger than
the physical memory size of a machine. The manner in which you
process the data in a large array will greatly affect the performance
because of the way your algorithm will interact with memory caches and
virtual memory paging. The amount of memory actually available to
your process is going to depend on what other processes are running on
the machine and so on.

Without sharing much more about your particular problem set I’m afraid
the answer to your question is going to be ‘It depends’. The best way
to improve on that answer is to experiment with the system in question.

Gary W.