简体   繁体   中英

linux pmap understanding what is running in specific virtual address space

We have some sort of a huge memory leak going on and our process' resident memory is increasing exponentially.

pmap -x shows something like:

...
00007f4ad85cd000 10530276 9129608 9129608 rw---    [ anon ]
....

this anon is the one that is responsible for the leak

similarly cat /proc//smaps showed something like:

7f4b03dfb000-7f4d5b146000 rw-p 00000000 00:00 0
Size:            9817388 kB
Rss:             8547272 kB
Pss:             8547272 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:   8547272 kB
Referenced:      6971056 kB
Anonymous:       8547272 kB
AnonHugePages:         0 kB
Swap:              80732 kB
KernelPageSize:        4 kB

now what? what can I do next to figure out what might be causing the issue? how to debug further? there is no core, really old code - no one knows where to add logs either.

How do I figure out what is contributing to 7f4b03dfb000-7f4d5b146000

You refer to your process. Is this a program you wrote, for which you have control of and access to the source code? Or is this some third party provided program?

If this is some third party program, you have little choice but to file a bug, and hope they can address it.

If this is your own code, you're going to need to use a tool to debug memory leaks. Depending on the programming language and libraries in use, different tools may be available to you.

One such tool is Valgrind .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM