I'm analyzing /proc/pid/smaps output for C++ process and I find large number of private memory mapped regions. Number of memory mapped regions keep growing based on the traffic. Is there a way I can track which part of the code creates memory blocks ?. I tried strace -p <pid>, But could not get to the stack while it is created. 00-7fcea0000000 rw-p 00000000 00:00 0Size:              65536 kBRss:               65520 kBPss:               65520 kBShared_Clean:          0 kBShared_Dirty:          0 kBPrivate_Clean:         0 kBPrivate_Dirty:     65520 kBReferenced:        65520 kBAnonymous:         65520 kBAnonHugePages:         0 kBSwap:                  0 kBKernelPageSize:        4 kBMMUPageSize:           4 kBLocked:                0 kBVmFlags: rd wr mr mw me nr sd7fcea4000000-7fcea8000000 rw-p 00000000 00:00 0Size:              65536 kBRss:               65516 kBPss:               65516 kBShared_Clean:          0 kBShared_Dirty:          0 kBPrivate_Clean:         0 kBPrivate_Dirty:     65516 kBReferenced:        65516 kBAnonymous:         65516 kBAnonHugePages:         0 kBSwap:                  0 kBKernelPageSize:        4 kBMMUPageSize:           4 kBLocked:                0 kBVmFlags: rd wr mr mw me nr sd7fceac000000-7fceb0000000 rw-p 00000000 00:00 0Size:              65536 kBRss:               65524 kBPss:               65524 kBShared_Clean:          0 kBShared_Dirty:          0 kBPrivate_Clean:         0 kBPrivate_Dirty:     65524 kBReferenced:        65524 kBAnonymous:         65524 kBAnonHugePages:         0 kBSwap:                  0 kBKernelPageSize:        4 kBMMUPageSize:           4 kBLocked:                0 kB                                                                                                                                                                                          7fceb4000000-7fceb8000000 rw-p 00000000 00:00 0Size:              65536 kBRss:               65528 kBPss:               65528 kBShared_Clean:          0 kBShared_Dirty:          0 kBPrivate_Clean:         0 kBPrivate_Dirty:     65528 kBReferenced:        65528 kBAnonymous:         65528 kBAnonHugePages:         0 kBSwap:                  0 kBKernelPageSize:        4 kBMMUPageSize:           4 kBLocked:                0 kBVmFlags: rd wr mr mw me nr sd7fcebc000000-7fcec0000000 rw-p 00000000 00:00 0Size:              65536 kBRss:               65516 kBPss:               65516 kBShared_Clean:          0 kBShared_Dirty:          0 kBPrivate_Clean:         0 kBPrivate_Dirty:     65516 kBReferenced:        65516 kBAnonymous:         65516 kBAnonHugePages:         0 kBSwap:                  0 kBKernelPageSize:        4 kBMMUPageSize:           4 kBLocked:                0 kBVmFlags: rd wr mr mw me nr sd7fcec4000000-7fcec8000000 rw-p 00000000 00:00 0Size:              65536 kBRss:               65504 kBPss:               65504 kBShared_Clean:          0 kBShared_Dirty:          0 kBPrivate_Clean:         0 kBPrivate_Dirty:     65504 kBReferenced:        65504 kBAnonymous:         65504 kBAnonHugePages:         0 kBSwap:                  0 kB                                                                                                                                                                                          332,20         2%
How to find part of the code which creates Anonymous private memory mapped region
memory;c++;mmap