Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > maximum hash/array keys/values

Reply
Thread Tools

maximum hash/array keys/values

 
 
Slickuser
Guest
Posts: n/a
 
      05-06-2008
What's the maximum hash/array in Perl can hold for keys and values?

Thanks.
 
Reply With Quote
 
 
 
 
A. Sinan Unur
Guest
Posts: n/a
 
      05-06-2008
Slickuser <(E-Mail Removed)> wrote in news:fb5a6ceb-5170-41bb-a278-
http://www.velocityreviews.com/forums/(E-Mail Removed):

> What's the maximum hash/array in Perl can hold for keys and values?


Please explain what you mean in a little bit more detail. What do you mean
by maximum hash or maximum array?

Sinan
--
A. Sinan Unur <(E-Mail Removed)>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      05-06-2008
Slickuser <(E-Mail Removed)> wrote:
> What's the maximum hash/array in Perl can hold for keys and values?


The maximum will depend on arcane details of your perl build. Almost
certainly your machine will run out of memory long, long before you reach
the internal limit, unless you are doing rather silly. Like this:

perl -le '$x[2**31-2]=8;'

It succeeded, but took 16 gig. 2**31-1 runs out of memory. 2**31 gives an
error of Modification of non-creatable array value attempted, subscript
-2147483648 at -e line 1.

Apparently even 64-bit builds use 32-bit ints for array indices.




Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 
Reply With Quote
 
Ilya Zakharevich
Guest
Posts: n/a
 
      05-06-2008
[A complimentary Cc of this posting was sent to

<(E-Mail Removed)>], who wrote in article <20080505232209.204$(E-Mail Removed)>:
> Slickuser <(E-Mail Removed)> wrote:
> > What's the maximum hash/array in Perl can hold for keys and values?

>
> The maximum will depend on arcane details of your perl build. Almost
> certainly your machine will run out of memory long, long before you reach
> the internal limit, unless you are doing rather silly. Like this:
>
> perl -le '$x[2**31-2]=8;'
>
> It succeeded, but took 16 gig. 2**31-1 runs out of memory. 2**31 gives an
> error of Modification of non-creatable array value attempted, subscript
> -2147483648 at -e line 1.
>
> Apparently even 64-bit builds use 32-bit ints for array indices.


Maybe. Also, it looks like the code to convert the size of array to
the size of the buffer-with-pointers-to-scalars defaults to 32-bit
integers for some intermediate values.

Could you report it to p5p as a bug?

Thanks,
Ilya
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating the maximum number of menus and maximum number of stills rossco DVD Video 2 11-24-2005 09:33 PM
Maximum number of Preferred Networks =?Utf-8?B?U01PbmV0?= Wireless Networking 0 08-01-2005 11:51 PM
Firefox Maximum Font Size?? Jonathan Wolgamuth Firefox 6 02-15-2005 04:41 AM
The number name 'System.Web.UI.WebControls' contains more than the maximum number of prefixes. The maximum is 3. mayur ASP .Net Web Controls 2 07-16-2004 05:14 PM
The number name 'System.Web.UI.WebControls' contains more than the maximum number of prefixes. The maximum is 3. mayur ASP .Net 2 07-02-2004 10:35 AM



Advertisments