Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: How to burn 100 megabytes in one line and still get the wrong answer

by Ven'Tatsu (Deacon)
on May 17, 2004 at 17:12 UTC ( #354035=note: print w/ replies, xml ) Need Help??


in reply to Re: How to burn 100 megabytes in one line and still get the wrong answer
in thread How to burn 100 megabytes in one line and still get the wrong answer

I belive perl will see the 'x' operator and try to allocate the necessary memory in one block. The OS will quickly not find a memory range large enough and fail the request, prompting perl to die. The alternative that would cause perl to die slowly would be if 'x' allocated a small string, copied it's first parameter into it until it ran out of space, then allocated a slightly larger sting, copied the old sting in, de-allocate the old sting, then continued to copy the first parameter until it ran out of room again. But that would be horribly inefficient. (even for perl =)


Comment on Re: Re: How to burn 100 megabytes in one line and still get the wrong answer

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2015-07-30 04:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls