Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Shrunk array takes more memory than original

by kroach (Pilgrim)
on Nov 10, 2015 at 12:03 UTC ( [id://1147349]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    say size(\@array);
    $#array = 5_000;
    say size(\@array);
    
  2. or download this
    80064
    80216
    
  3. or download this
    my @array = 1 .. 10_000;
    say size(\@array);
    splice @array, 5_001;
    say size(\@array);
    
  4. or download this
    80064
    80064
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1147349]
Approved by Eily
Front-paged by LanX
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-26 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found