Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Shrunk array takes more memory than original

by kroach (Pilgrim)
on Nov 10, 2015 at 12:03 UTC ( #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 imbibing at the Monastery: (8)
As of 2023-12-06 16:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (30 votes). Check out past polls.

    Notices?