Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: one-liner hogs

by Trinary (Pilgrim)
on Feb 01, 2001 at 03:37 UTC ( #55600=note: print w/replies, xml ) Need Help??

in reply to one-liner hogs

Very basic one:
perl -e 'while (++$i) { $foo[$i] = $i; }'
That'll chew memory like mad, and soon bomb out. CPU usage minimal.

of course, you can make it use CPU...

perl -e 'fork; fork; while (++$i) { $c .= crypt($i,$i); $c = substr($c +,4,128); }
Ctrl-C kills all children, no root required! Load should fly up to around 4, give it a minute or two. To add mem usage, change the substr length.

Fun request!


Replies are listed 'Best First'.
Re: Re: one-liner hogs
by premchai21 (Curate) on Feb 28, 2001 at 06:36 UTC
    My humble contribution: while (++$i) { $foo{$i}=[ @foo ]; $foo[$i]=[ %foo, $i ]; } bounces back and forth making new arrays of ever-increasing size. Allocated about 350MB in about 30 secs. Uses a lot of processor, though.

    Agreed. Quite fun deliberately pessimizing code.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2021-07-30 21:24 GMT
Find Nodes?
    Voting Booth?

    No recent polls found