aspose file tools*
The moose likes Linux / UNIX and the fly likes what is the difference between /proc/pid/statm  and top for the special process Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "what is the difference between /proc/pid/statm  and top for the special process" Watch "what is the difference between /proc/pid/statm  and top for the special process" New topic
Author

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

jing hu
Ranch Hand

Joined: Jun 30, 2009
Posts: 63
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

Joined: Aug 16, 2005
Posts: 14274
    
  21

What version of what operating system are you using? Not all Unix-like operating systems are exactly the same with regards to these commands.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
jing hu
Ranch Hand

Joined: Jun 30, 2009
Posts: 63
The operation system is suse 11. I just think there should not have so big difference between the two values
 
 
subject: what is the difference between /proc/pid/statm and top for the special process