Skip to content

Instantly share code, notes, and snippets.

@timo
Last active August 29, 2015 13:56
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 timo/544d3d75bd92932e635d to your computer and use it in GitHub Desktop.
Save timo/544d3d75bd92932e635d to your computer and use it in GitHub Desktop.
MoarVM nursery/heap analyzer
(gdb) run
Starting program: /home/timo/perl6/install/bin/moar --libpath=/home/timo/perl6/rakudo/../install/languages/nqp/lib --libpath=/home/timo/perl6/rakudo/../install/languages/perl6/lib --libpath=/home/timo/perl6/rakudo/../install/languages/perl6/runtime /home/timo/perl6/rakudo/../install/languages/perl6/runtime/perl6.moarvm -e say\ 1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, MVM_gc_enter_from_allocator (tc=tc@entry=0x603430) at src/gc/orchestrate.c:305
305 void MVM_gc_enter_from_allocator(MVMThreadContext *tc) {
(gdb) moar-heap
starting to analyze the nursery:
__________________________________________________
--------------------------------------------------
the current generation of the gc is 0
nursery state:
[===================] 99 %
76401 objects; 1 type objects; 1 STables
sizes of objects/stables:
24 [ 1 24
32 [========================= 15497 495.904
40 [===== 3400 136.000
48 [========= 5548 266.304
56 [================================================== 30641 1.715.896
64 [ 163 10.432
72 [================================= 20523 1.477.656
80 [ 2 160
88 [ 5 440
96 [ 7 672
104 [ 15 1.560
120 [ 6 720
144 [ 432 62.208
152 [ 96 14.592
160 [ 38 6.080
168 [ 5 840
176 [ 1 176
200 [ 23 4.600
sizes of P6opaques only:
32 [ 25 800
40 [======= 3399 135.960
48 [===== 2778 133.344
56 [================================================== 24152 1.352.512
64 [ 161 10.304
72 [ 3 216
80 [ 2 160
88 [ 2 176
96 [ 7 672
104 [ 15 1.560
120 [ 6 720
144 [ 432 62.208
152 [ 96 14.592
168 [ 5 840
176 [ 1 176
REPRs:
P6opaque [================================================== 31084
MVMCode [================================= 20519
P6int [============= 8675
VMHash [===== 3719
MVMString [===== 3274
VMArray [==== 2938
P6str [==== 2723
Lexotic [==== 2548
VMIter [ 277
MVMCallCapture [ 221
MVMContext [ 202
P6num [ 128
MVMMultiCache [ 37
SCRef [ 24
MVMCompUnit [ 23
MVMOSHandle [ 3
P6bigint [ 2
VMException [ 2
STable [ 1
KnowHOWREPR [ 1
MVMDLLSym [ 1
MVMThread [ 1
VMArray storage types:
obj [================================================== 2798
---Type <return> to continue, or q <return> to quit---
i64 [== 116
str [ 24
VMArray usage percentages:
0 [=============== 393
10 [========================= 660
20 [============== 379
30 [== 75
50 [= 43
60 [= 31
70 [ 21
80 [ 16
90 [ 11
100 [= 31
N/A [================================================== 1278
(gdb) finish
Run till exit from #0 MVM_gc_enter_from_allocator (tc=tc@entry=0x603430) at src/gc/orchestrate.c:305
MVM_gc_allocate_nursery (tc=tc@entry=0x603430, size=56) at src/gc/allocation.c:29
29 while ((char *)tc->nursery_alloc + size >= (char *)tc->nursery_alloc_limit) {
(gdb) moar-heap
starting to analyze the nursery:
__________________________________________________
--------------------------------------------------
the current generation of the gc is 1
nursery state:
[== ] 12 %
8684 objects; 1 type objects; 1 STables
sizes of objects/stables:
24 [ 1 24
32 [=============================================== 3074 98.368
40 [ 33 1.320
48 [ 54 2.592
56 [=========================== 1790 100.240
64 [ 35 2.240
72 [================================================== 3219 231.768
88 [ 5 440
96 [ 7 672
104 [ 15 1.560
120 [ 6 720
144 [==== 284 40.896
152 [= 96 14.592
160 [ 38 6.080
168 [ 5 840
176 [ 1 176
200 [ 23 4.600
sizes of P6opaques only:
32 [ 2 64
40 [===== 33 1.320
48 [====== 39 1.872
56 [================================================== 287 16.072
64 [===== 34 2.176
72 [ 3 216
88 [ 2 176
96 [= 7 672
104 [== 15 1.560
120 [= 6 720
144 [================================================= 284 40.896
152 [================ 96 14.592
168 [ 5 840
176 [ 1 176
REPRs:
MVMCode [================================================== 3215
P6int [======================= 1486
P6str [==================== 1348
VMArray [============= 845
P6opaque [============ 814
MVMString [========== 655
VMHash [== 183
MVMMultiCache [ 37
SCRef [ 24
MVMCompUnit [ 23
MVMContext [ 20
Lexotic [ 13
P6num [ 10
MVMOSHandle [ 3
VMIter [ 3
P6bigint [ 2
KnowHOWREPR [ 1
VMException [ 1
MVMThread [ 1
STable [ 1
MVMCallCapture [ 1
VMArray storage types:
obj [================================================== 728
i64 [======= 116
str [ 1
---Type <return> to continue, or q <return> to quit---
VMArray usage percentages:
0 [ 1
10 [========= 111
20 [===== 65
30 [ 10
50 [== 29
60 [= 22
70 [= 14
80 [ 11
90 [ 7
100 [ 7
N/A [================================================== 568
(gdb) diff-moar-heap
nursery state --DIFF--:
sizes of objects/stables:
24 [ 1 -> 1 24 -> 24
32 [+++++-------------------- 15497 -> 3074 495.904 -> 98.368
40 [----- 3400 -> 33 136.000 -> 1.320
48 [-------- 5548 -> 54 266.304 -> 2.592
56 [++----------------------------------------------- 30641 -> 1790 1.715.896 -> 100.240
64 [ 163 -> 35 10.432 -> 2.240
72 [+++++---------------------------- 20523 -> 3219 1.477.656 -> 231.768
80 [ 2 -> 0 160 -> 0
88 [ 5 -> 5 440 -> 440
96 [ 7 -> 7 672 -> 672
104 [ 15 -> 15 1.560 -> 1.560
120 [ 6 -> 6 720 -> 720
144 [ 432 -> 284 62.208 -> 40.896
152 [ 96 -> 96 14.592 -> 14.592
160 [ 38 -> 38 6.080 -> 6.080
168 [ 5 -> 5 840 -> 840
176 [ 1 -> 1 176 -> 176
200 [ 23 -> 23 4.600 -> 4.600
sizes of P6opaques only:
32 [ 25 -> 2 800 -> 64
40 [------ 3399 -> 33 135.960 -> 1.320
48 [----- 2778 -> 39 133.344 -> 1.872
56 [------------------------------------------------- 24152 -> 287 1.352.512 -> 16.072
64 [ 161 -> 34 10.304 -> 2.176
72 [ 3 -> 3 216 -> 216
80 [ 2 -> 0 160 -> 0
88 [ 2 -> 2 176 -> 176
96 [ 7 -> 7 672 -> 672
104 [ 15 -> 15 1.560 -> 1.560
120 [ 6 -> 6 720 -> 720
144 [ 432 -> 284 62.208 -> 40.896
152 [ 96 -> 96 14.592 -> 14.592
168 [ 5 -> 5 840 -> 840
176 [ 1 -> 1 176 -> 176
REPRs:
P6opaque [+------------------------------------------------ 31084 -> 814
MVMCode [+++++--------------------------- 20519 -> 3215
P6int [++----------- 8675 -> 1486
VMHash [----- 3719 -> 183
MVMString [+---- 3274 -> 655
VMArray [+--- 2938 -> 845
P6str [++-- 2723 -> 1348
Lexotic [---- 2548 -> 13
VMIter [ 277 -> 3
MVMCallCapture [ 221 -> 1
MVMContext [ 202 -> 20
P6num [ 128 -> 10
MVMMultiCache [ 37 -> 37
SCRef [ 24 -> 24
MVMCompUnit [ 23 -> 23
MVMOSHandle [ 3 -> 3
P6bigint [ 2 -> 2
VMException [ 2 -> 1
MVMThread [ 1 -> 1
STable [ 1 -> 1
KnowHOWREPR [ 1 -> 1
MVMDLLSym [ 1 -> 0
VMArray storage types:
obj [+++++++++++++------------------------------------ 2798 -> 728
i64 [-- 116 -> 116
str [ 24 -> 1
VMArray usage percentages:
0 [--------------- 393 -> 1
10 [++++--------------------- 660 -> 111
20 [++------------ 379 -> 65
30 [-- 75 -> 10
50 [+ 43 -> 29
60 [ 31 -> 22
---Type <return> to continue, or q <return> to quit---
70 [ 21 -> 14
80 [ 16 -> 11
90 [ 11 -> 7
100 [ 31 -> 7
N/A [++++++++++++++++++++++--------------------------- 1278 -> 568
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment