Skip to content

Instantly share code, notes, and snippets.

@pmichaud
Created July 2, 2012 14:35
Show Gist options
  • Select an option

  • Save pmichaud/3033548 to your computer and use it in GitHub Desktop.

Select an option

Save pmichaud/3033548 to your computer and use it in GitHub Desktop.
Guess how much memory this program uses?
pmichaud@kiwi:~/p6/parrot$ cat gc-sub.pir
.sub 'main' :main
.local int N
N = 1000000
$I0 = 0
loop:
unless $I0 < N goto done
'no-op'()
inc $I0
goto loop
done:
sleep 1440
.end
.sub 'no-op'
noop
.end
pmichaud@kiwi:~/p6/parrot$ ./parrot gc-sub.pir &
[1] 25854
pmichaud@kiwi:~/p6/parrot$ ps -C parrot -o vsz,cmd
VSZ CMD
239476 ./parrot gc-sub.pir
pmichaud@kiwi:~/p6/parrot$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment