Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Memory usage double expected

by bliako (Monsignor)
on Oct 28, 2022 at 08:22 UTC ( [id://11147775]=note: print w/replies, xml ) Need Help??


in reply to Memory usage double expected

For investigating this further (in Linux):

print "pid:$$\n"; my $x = 'monks' x (3); sleep 60;

and then use gcore <pid> to dump the memory of said process to file (called core.<pid>) and then find occurences of "monks" either with strings core.<pid> | grep monks or hexdump -C core.<pid> | grep monks

true to what the explanation offered to perlmonks above, the anonymous monk firstly:

print "$$\n"; my $n = 3; $x = 'monks' x ($n); sleep 60;
monksmonksmonks monks

contrast to

print "$$\n"; $x = 'monks' x (3); sleep 60;
monksmonksmonks monksmonksmonks monksmon<

bw, bliako

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11147775]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-25 11:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found