Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pmichaud
Created July 1, 2012 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmichaud/3030004 to your computer and use it in GitHub Desktop.
Save pmichaud/3030004 to your computer and use it in GitHub Desktop.
pmichaud@kiwi:~/p6/parrot$ git describe --tags
RELEASE_4_5_0-7-g66923d2
pmichaud@kiwi:~/p6/parrot$ cat gc-1.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 < 1000000 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-1.pir
gc_mark_runs=0
gc_collect_runs=0
total_pmcs=1002150
active_pmcs=1001996
total_mem_alloc=64913408
total_mem_used=56317933
pmichaud@kiwi:~/p6/parrot$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment