Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks
How to find the size of memory taking the executing script, see below example
open(FH,"file.txt") or die "file not found"; my $line=0; my %hash = undef; while(<FH>) { $hash{$line} = undef; #6ht line $line++; } close FH; ##### # Here i want print the total memory occupied by this script ####
Actully, i running this script in windows, and observed the available memory under the physical memory in taskmanger. So gradully decreasing, that means the script taking memory, that taking memory want to print, once completed the script the available memory as normal in taskmanager. And when i commented the 6th line in script, its not taking that much memory becaz of hash.
So, please tell me, how to know the memory that dynamically allocating in the script and print the memory at end of script
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Allocated memory to Script
by BrowserUk (Patriarch) on Jul 08, 2011 at 10:50 UTC | |
|
Re: Allocated memory to Script
by Anonymous Monk on Jul 08, 2011 at 10:39 UTC | |
|
Re: Allocated memory to Script
by Khen1950fx (Canon) on Jul 08, 2011 at 12:17 UTC | |
by BrowserUk (Patriarch) on Jul 08, 2011 at 12:42 UTC | |
by Khen1950fx (Canon) on Jul 08, 2011 at 13:30 UTC | |
by BrowserUk (Patriarch) on Jul 08, 2011 at 13:38 UTC | |
by Anonymous Monk on Jul 08, 2011 at 13:41 UTC | |
| |
by Anonymous Monk on Jul 08, 2011 at 13:35 UTC |