Estou analisando /proc/pid/smaps
output para o processo C ++ e localizo um grande número de regiões mapeadas de memória privada. O número de regiões mapeadas na memória continua crescendo com base no tráfego.
Existe uma maneira de rastrear qual parte do código cria blocos de memória? Eu tentei strace -p <pid>
, mas não consegui chegar à pilha enquanto ela é criada.
00-7fcea0000000 rw-p 00000000 00:00 0
Size: 65536 kB
Rss: 65520 kB
Pss: 65520 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 65520 kB
Referenced: 65520 kB
Anonymous: 65520 kB
AnonHugePages: 0 kB
Swap: 0 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Locked: 0 kB
VmFlags: rd wr mr mw me nr sd
7fcea4000000-7fcea8000000 rw-p 00000000 00:00 0
Size: 65536 kB
Rss: 65516 kB
Pss: 65516 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 65516 kB
Referenced: 65516 kB
Anonymous: 65516 kB
AnonHugePages: 0 kB
Swap: 0 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Locked: 0 kB
VmFlags: rd wr mr mw me nr sd
7fceac000000-7fceb0000000 rw-p 00000000 00:00 0
Size: 65536 kB
Rss: 65524 kB
Pss: 65524 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 65524 kB
Referenced: 65524 kB
Anonymous: 65524 kB
AnonHugePages: 0 kB
Swap: 0 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Locked: 0 kB
7fceb4000000-7fceb8000000 rw-p 00000000 00:00 0
Size: 65536 kB
Rss: 65528 kB
Pss: 65528 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 65528 kB
Referenced: 65528 kB
Anonymous: 65528 kB
AnonHugePages: 0 kB
Swap: 0 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Locked: 0 kB
VmFlags: rd wr mr mw me nr sd
7fcebc000000-7fcec0000000 rw-p 00000000 00:00 0
Size: 65536 kB
Rss: 65516 kB
Pss: 65516 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 65516 kB
Referenced: 65516 kB
Anonymous: 65516 kB
AnonHugePages: 0 kB
Swap: 0 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Locked: 0 kB
VmFlags: rd wr mr mw me nr sd
7fcec4000000-7fcec8000000 rw-p 00000000 00:00 0
Size: 65536 kB
Rss: 65504 kB
Pss: 65504 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 65504 kB
Referenced: 65504 kB
Anonymous: 65504 kB
AnonHugePages: 0 kB
Swap: 0 kB
332,20 2%