• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the difference between /proc/pid/statm and top for the special process

 
jing hu
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for example
I want to watch a process memory info which pid is 5745.
So I typed the command:
top -p 5745
And top show that the process RES is 700m, VIRT is 848m

now I view the /proc/5745/statm, the file content is :
217088 179228 2251 59 0 207252 0

I want to know whether or not the column 2 of file statm is the process 5745 RES. why the two values have so big difference?

Thanks for any reply.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15216
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of what operating system are you using? Not all Unix-like operating systems are exactly the same with regards to these commands.
 
jing hu
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The operation system is suse 11. I just think there should not have so big difference between the two values
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic