Satwik Krishna
Satwik Krishna

Reputation: 61

Virtual Memory Statistics per process

I am working on a very wierd Memory leak issue and this resulted into the following problem. I have a process running on my system which increases its Virtual Memory size after a certain operation is made.Now in order to confirm the issue is not a memory leak issue I want to get statistics for the number of free and used pages held by the process when its currently running. I am aware of vmstat command which gives the same statistics for the entire system.But for my confirmation I need a per process vmstat command. Does anyone have a idea how this can be done ?

Upvotes: 2

Views: 969

Answers (2)

apangin
apangin

Reputation: 98380

/proc/PID/smaps file will give you exhaustive information on all regions of virtual memory held by the given process.

Upvotes: 2

Alireza
Alireza

Reputation: 166

If you're coding in C/C++, dynamic analysis tool like Valgrind could be useful. http://valgrind.org/

Upvotes: 1

Related Questions