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.