-
-
Save timo/6a6550b8eac823d3ac47a0728e4ff3cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
timo@schmand /tmp> perl6 --profile=heap testshellmem.p6 shell | |
Before shell call : 101.664 kb | |
html is 230457 chars | |
After shell call : 210.332 kb | |
After forced gc: 249.704 kb | |
html is 230457 chars | |
After shell call : 323.016 kb | |
After forced gc: 354.232 kb | |
html is 230457 chars | |
After shell call : 401.640 kb | |
After forced gc: 418.024 kb | |
html is 230457 chars | |
After shell call : 418.024 kb | |
After forced gc: 418.024 kb | |
html is 230457 chars | |
After shell call : 418.088 kb | |
After forced gc: 418.088 kb | |
html is 230457 chars | |
After shell call : 418.152 kb | |
After forced gc: 418.152 kb | |
html is 230457 chars | |
After shell call : 418.152 kb | |
After forced gc: 418.152 kb | |
html is 230457 chars | |
After shell call : 418.152 kb | |
After forced gc: 418.152 kb | |
html is 230457 chars | |
After shell call : 418.152 kb | |
After forced gc: 418.152 kb | |
html is 230457 chars | |
After shell call : 418.152 kb | |
After forced gc: 418.152 kb | |
After sleep 5 : 418.152 kb | |
Heap snapshot written to heap-snapshot-1504868482.9648 | |
timo@schmand /tmp> mv heap-snapshot-1504868482.9648 heap-snapshot-shell-sub | |
timo@schmand /tmp> perl6 --profile=heap testshellmem.p6 qqx | |
Before shell call : 101.776 kb | |
html is 230457 chars | |
After shell call : 180.612 kb | |
After forced gc: 216.272 kb | |
html is 230457 chars | |
After shell call : 285.692 kb | |
After forced gc: 310.268 kb | |
html is 230456 chars | |
After shell call : 387.244 kb | |
After forced gc: 411.820 kb | |
html is 230457 chars | |
After shell call : 411.820 kb | |
After forced gc: 411.820 kb | |
html is 230456 chars | |
After shell call : 412.140 kb | |
After forced gc: 412.140 kb | |
html is 230457 chars | |
After shell call : 412.140 kb | |
After forced gc: 412.140 kb | |
html is 230457 chars | |
After shell call : 412.144 kb | |
After forced gc: 412.144 kb | |
html is 230457 chars | |
After shell call : 412.144 kb | |
After forced gc: 412.144 kb | |
html is 230457 chars | |
After shell call : 412.144 kb | |
After forced gc: 412.144 kb | |
html is 230456 chars | |
After shell call : 412.160 kb | |
After forced gc: 412.160 kb | |
After sleep 5 : 412.160 kb | |
Heap snapshot written to heap-snapshot-1504868530.9759 | |
timo@schmand /tmp> mv heap-snapshot-1504868530.9759 heap-snapshot-qqx | |
timo@schmand /tmp> perl6 --profile=heap testshellmem.p6 run | |
Before shell call : 101.604 kb | |
html is 230457 chars | |
After shell call : 211.148 kb | |
After forced gc: 249.548 kb | |
html is 230457 chars | |
After shell call : 318.508 kb | |
After forced gc: 343.084 kb | |
html is 230457 chars | |
After shell call : 394.464 kb | |
After forced gc: 410.848 kb | |
html is 230456 chars | |
After shell call : 410.848 kb | |
After forced gc: 410.848 kb | |
html is 230457 chars | |
After shell call : 410.992 kb | |
After forced gc: 410.992 kb | |
html is 230457 chars | |
After shell call : 411.248 kb | |
After forced gc: 411.248 kb | |
html is 230457 chars | |
After shell call : 411.248 kb | |
After forced gc: 411.248 kb | |
html is 230457 chars | |
After shell call : 411.248 kb | |
After forced gc: 411.248 kb | |
html is 230456 chars | |
After shell call : 412.272 kb | |
After forced gc: 412.272 kb | |
html is 230456 chars | |
After shell call : 413.172 kb | |
After forced gc: 413.172 kb | |
After sleep 5 : 413.172 kb | |
Heap snapshot written to heap-snapshot-1504868591.0786 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Linux::Proc::Statm; | |
sub mem($a) { | |
say $a ~ get-statm<data>.flip.comb(/.**1..3/).join('.').flip ~ ' kb'; | |
} | |
mem("Before shell call : "); | |
my $html; | |
if @*ARGS[0] eq "qqx" { | |
$html = qqx{wget -o /dev/null -O - https://www.fimfiction.net/bookshelf/149291/}; | |
} | |
if @*ARGS[0] eq "shell" { | |
my $proc = shell "wget -o /dev/null -O - https://www.fimfiction.net/bookshelf/149291/", :out; | |
$html = $proc.out.slurp; | |
} | |
if @*ARGS[0] eq "run" { | |
my $proc = run "wget", "-o", "/dev/null", "-O", "-", "https://www.fimfiction.net/bookshelf/149291/", :out; | |
$html = $proc.out.slurp; | |
} | |
say "html is " ~ $html.chars ~ " chars"; | |
mem("After shell call : "); | |
sleep 5; | |
mem("After sleep 5 : "); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment