Re: Max size of an array used in perl.



On Jan 30, 6:47 am, "Paul Lalli" <mri...@xxxxxxxxx> wrote:

There is no built-in limit in the language. It is limited only by the
amount of memory your computer system has available.

And how willing you are to let your machine go to a crawl if you
exceed the available physical RAM.

Oses these days aren't limited by RAM. They'll allocate disk as swap
space, which frees RAM to hold more, which then gives Perl the go-
ahead to load more data, which then gets swapped back out to disk.
Disk is slower than RAM so the machine will go to a crawl.

And, unfortunately, there are some things that are easy to do in Perl
that can put you in that situation, like slurping big data files
without checking to see how big they are first or trying to hold huge
structures in memory instead of reverting to using a database.

Back to the original poster's question -

Knowing that Perl will create an array big enough to fill memory
should prompt more specific questions, like "how many array entries
can I effectively access if they are of type X?", and "Is there a
better way to store and access data type Y?" and let us know what
you're going to store or access or try to do with it.

"How big" is too generic and leads to generic answers that don't
really help you.

.



Relevant Pages

  • Re: Perl garbage collector
    ... Does your OS have a function that allows processes to return memory to ... As you see some RAM is given back to the OS ... I would expect that the Perl virtual machine ... memory allocation and garbage collection. ...
    (perl.beginners)
  • Re: Memory issues
    ... I observed malloc is called 1871 times when free is just called ... But this mean it is not possible to free the memory consumed by one ... I run perl processes that use up to 8 Gb of RAM and run for months ... This mean you have a 8 Gbytes RAM memory computer. ...
    (comp.lang.perl.misc)
  • Re: Exploiting the Perl
    ... CO> snip ... CO> data structures were leaked by the Perl program and continued to take ... CO> up memory, which would mean if you could get the address of the memory ... stored to disk and later reloaded in to ram and usable. ...
    (perl.beginners)
  • Re: Memory issues
    ... I observed malloc is called 1871 times when free is just called ... Please keep in mind that perl's memory allocation strategy in general is ... Or at least one perl function to release the memory used by a function ... Perl algorithms tend to exchange RAM for speed in most cases ...
    (comp.lang.perl.misc)
  • Dumpster Dell saga SUCCESS !!!!!!!!
    ... programs everything would slow to a crawl and take 20 minutes to shut ... Then I read how low memory can make things slow and I found out how to ... This model Dell came with 128 Ram so I bought and installed ...
    (alt.os.windows-xp)