#!/usr/bin/perl -w use strict; use Set::Scalar; use Storable qw(nfreeze thaw); my $iterations = 20; my $set_count = 100; my $data = 'abcdefgh'; srand(); for (my $cycle = 0; $cycle < $iterations; $cycle ++) { { my $tmp = $data; my $r_arr; $tmp .= chr(int(rand(26))+65); for (my $set = 0; $set < $set_count; $set ++) { my $scalar_set = Set::Scalar->new(split(//, $tmp)); push @$r_arr, thaw( nfreeze( $scalar_set ) ); } } &procinfo; } exit 0; sub procinfo { my @stat; open( STAT , '<', "/proc/$$/stat" ) or die "Unable to open stat file"; @stat = split /\s+/ , ; close( STAT ); printf "Vsize: %3.2f MB\t", $stat[22]/1048576; print "RSS : $stat[23] pages\n"; }