views:

83

answers:

3

We're running to profile a java program on its memory usage. We have a 512 ram box and top shows that 500 or so MB of ram is used with very little free. However over at the RES column we can see that the jvm is only using 100MB or so. And all the other processes are not even significant (less than 1k). So what exactly is consuming all the memory or are we just reading the top wrong?

A: 

That's reserved memory. The process doesn't use it, it's reserved for it. Should another process want to allocate more memory, it would get the permission.

Jes
No it's not, RES is Resident Set Size - physical memory in use by the task.
caf
A: 

Also memory that is used by multiple applications (think dynamic libraries) is counted every time it is referenced even though it takes up one copy. Try using htop too.

Matt Williamson
+1  A: 

That 500MB includes memory used by the page cache - cached parts of disk files. This memory is reclaimable for use by processes - so if you add the memory listed as "free" to that listed as "cached", then you will have the memory that is still available for use by tasks.

Alternatively, you can use the free command, which lists this figure in the "free" column on the -/+ buffers/cache: line.

caf
`man free` for details
sanmai