#!/usr/bin/perl #In this script the command system("date"); fails after 2 large arrays have been setup. #The test machine has 4Gb RAM and 2.4 Gb swap. use strict; use warnings; my $i = 0; my $j = 0; my @array1 = ""; my @array2 = ""; my $cmd = ""; my $result = ""; my $doze = 15; system("free -m"); #Using system() print '#Before array setup - using system("date");: '; system("date"); printf "\n\$?=0x%x \$!=%s\n", $?, $!; #Setup big arrays for ($i = 1; $i <= 5760; $i++) { for ($j = 1; $j <= 2880; $j++) { $array1[$i][$j] = "<1234567890,1234567890,1234567890>"; $array2[$i][$j] = "<1234567890,1234567890,1234567890>"; } } print "#Finished setup of two arrays $i x $j\n#Going to sleep for $doze seconds - go and run free -m\n"; sleep $doze; print "#Awake again\n"; #Using system() print '#After array setup - using system("date");: '; system("date"); printf "\n\$?=0x%x \$!=%s\n", $?, $!; print "\n#End\n"; exit;