Created
July 1, 2012 23:34
-
-
Save pmichaud/3030034 to your computer and use it in GitHub Desktop.
This file contains 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
pmichaud@kiwi:~/p6/parrot$ cat gc-10.pir | |
.include 'interpinfo.pasm' | |
.sub 'main' :main | |
# This loop simply creates a large number of ResizablePMCArrays, | |
# releasing(?) any previously allocated RPA on each iteration | |
# through the loop. | |
$I0 = 0 | |
loop: | |
unless $I0 < 10000000 goto done | |
$P0 = new ['ResizablePMCArray'] | |
inc $I0 | |
goto loop | |
done: | |
# Now display the current memory consumption statistics. | |
print "gc_mark_runs=" | |
$I0 = interpinfo .INTERPINFO_GC_MARK_RUNS | |
say $I0 | |
print "gc_collect_runs=" | |
$I0 = interpinfo .INTERPINFO_GC_COLLECT_RUNS | |
say $I0 | |
print "total_pmcs=" | |
$I0 = interpinfo .INTERPINFO_TOTAL_PMCS | |
say $I0 | |
print "active_pmcs=" | |
$I0 = interpinfo .INTERPINFO_ACTIVE_PMCS | |
say $I0 | |
print "total_mem_alloc=" | |
$I0 = interpinfo .INTERPINFO_TOTAL_MEM_ALLOC | |
say $I0 | |
print "total_mem_used=" | |
$I0 = interpinfo .INTERPINFO_TOTAL_MEM_USED | |
say $I0 | |
.end | |
pmichaud@kiwi:~/p6/parrot$ ./parrot gc-10.pir | |
gc_mark_runs=3 | |
gc_collect_runs=0 | |
total_pmcs=2990640 | |
active_pmcs=1042668 | |
total_mem_alloc=192630784 | |
total_mem_used=58585563 | |
pmichaud@kiwi:~/p6/parrot$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The oddity of there being no collect runs may have something to do with the fact that all the RPA's that you create are in the same scope. It would be interesting to compare it to similar code which does exactly the same thing, but uses a PIR function instead of labels and goto.