in reply to Re^4: Memory management
in thread Memory management
Anyway with TaskInfo you can see how many files and exactly which ones a process has open and details like that which aren't available in the Windows Task Manager (what's paged in/out, etc). Doing advanced things like dynamically lowering the priority of a thread within a process is possible! Whoa!
So anyway on to your question with some code!
I wrote this "quickie" thing...
Run with std Windows TaskManager open and this Perl program in the command window so that you watch both at the same time.
The Windows Task Manager is a bit weird. But this will show a clear spike in memory usage. Then you see the point that the @list has nothing in it anymore, but that won't change windows process usage. Then finally Perl ends and level drops back to what it was before. As Windows background things come and go (like virus software, there are variations, but this @list thing is big enough that the results should be clear.
#!/usr/bin/perl -w use strict; use Data::Dumper; my @list; populate_list(\@list,10000000); countdown(10); @list = (); #list has nothing in it now countdown(10); sub populate_list { my ($lref,$num) = @_; foreach my $x (0..$num) { push (@$lref, $x); } } sub countdown { my $num = shift; while ($num--){sleep(1);print "countdown $num\n";} }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Memory management
by Anonymous Monk on Aug 14, 2009 at 12:31 UTC | |
by Marshall (Canon) on Aug 14, 2009 at 12:53 UTC | |
|
Re^6: Memory management
by desemondo (Hermit) on Aug 16, 2009 at 11:17 UTC | |
by Marshall (Canon) on Aug 18, 2009 at 16:37 UTC | |
by desemondo (Hermit) on Aug 20, 2009 at 10:04 UTC |