1 The following are examples of pl_malloc.d.
3 This is an expiremental script that attepmts to identify who is calling
4 malloc() from Perl, and to print byte distribution plots.
6 Here it traces the example program, Code/Perl/func_malloc.pl.
8 # pl_malloc.d -c ./func_malloc.pl
12 Tracing... Hit Ctrl-C to end.
14 Perl malloc byte distributions by engine caller,
16 perl`perl_alloc, total bytes = 1
17 value ------------- Distribution ------------- count
19 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
22 libc.so.1`_findbuf, total bytes = 520
23 value ------------- Distribution ------------- count
25 512 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
28 perl`Perl_safesysmalloc, total bytes = 72106
29 value ------------- Distribution ------------- count
34 16 |@@@@@@@@@@@@@@ 216
46 Perl malloc byte distributions by Perl file and subroutine,
48 func_malloc.pl, func_a, bytes total = 42504
49 value ------------- Distribution ------------- count
51 32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
54 func_malloc.pl, func_b, bytes total = 100008
55 value ------------- Distribution ------------- count
57 4 |@@@@@@@@@@@@@@@@@@@@ 1
71 65536 |@@@@@@@@@@@@@@@@@@@@ 1
74 The func_malloc.pl program allocated around 100 Kbytes by creating a
75 variable ($b) and populating it with 100,000 "b" characters. This has been
76 identified in the last distribution plot printed, with one malloc event
77 of between 64 Kbytes and 128 Kbytes in size. There was also a malloc event
78 of between 4 and 7 bytes in size.