Top and Prstat display different results for memory

I have a question about the accuracy of prstat.

I did a 'prstat -t' and it shows 99% of my memory is occupied by oracle.

NPROC USERNAME SIZE RSS MEMORY TIME CPU
194 oracle 343G 340G 99% 86:17.24 56%

However, 'top' shows I still have 7762meg of memory free.

Memory: 16G real, 7762M free, 80K swap in use, 8203M swap free

A vmstat shows the following.

procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr s6 s1 s1 s1 in sy cs us sy id
0 0 0 16639088 8461488 0 0 0 0 0 0 0 0 82 95 0 4294967196 0 0 -561 -113 -1069
0 0 0 16172032 7959784 5301 3 16992 0 0 0 0 0 4 739 0 4266 9154 1265 25 12 63
0 1 0 16172032 7959848 1539 319 10020 0 0 0 0 0 0 321 0 3709 12723 1531 32 11 57
0 0 0 16172000 7959880 763 319 7772 0 0 0 0 0 1 234 0 3286 8636 1433 26 4 69
0 0 0 16172032 7959912 671 0 5756 0 0 0 0 0 1 179 0 3154 7395 1473 22 3 76

All my other servers are showing the same discrepancies in prstat and top. From vmstat and top, I still have alot of memory available.

Does anyone know how prstat derives the 99% of memory usage which I doubt is accurate at all.

No one can read stuff when you squeeze out all of the blanks. Normally, when a user does not use code tags, I can edit a user's post and insert code tags to cause the spaces to be shown. Somehow you have removed the spaces so I cannot repair your post to readability.

prstat is trying to tell you that 99% of the stuff in virtual memory is also in physical memory. This is quite accurate and means you must have plenty of memory. The remaining 1% won't pop into existence until it is needed...some pages of a program are just never used.

Thanks for the reply. Apologies for the spaces but strangely though I did not remove any spaces. Could be because of the missing code tags. The results were copied and pasted from Putty.

It's misleading though, this 99%. I do have servers running at 100% memory from prstat results but still have abundant memory available.

prstat -t

 NPROC USERNAME  SIZE   RSS MEMORY      TIME  CPU
   540 oracle   1529G 1519G   100%  66:53.19  54%

top

Memory: 16G real, 7949M free, 8203M swap free

vmstat

 procs     memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr s6 s1 s1 s1   in   sy   cs us sy id
 0 0 0 17085024 8945808 1350 200 1475 1 1 0 0 0 0 0  0 1350 1674  274 24  5 71

Again, this means that 100% of the objects in virtual memory are also in physical memory. This does not mean that you have used 100% of physical memory. It means you had ALL of the physical memory that you are trying to use! Yes, you might some empty physical memory left over! prstat does not report anything about unused physical memory! You cannot use prstat to determine unused physical memory. prstat only sees physical memory in use. It cannot see unused physical memory.

Let's take an example... imagine a computer with 1024 Gigabytes of physical memory. You want to run one program that needs 1 gigabyte of memory. prstat sees that you are trying to use one gigabyte. prstat also sees that you managed to find one gigabyte to use. So it says that 100 % of virtual memory is in physical memory. What about the the other 1023 GB? prstat does not know about that. It is not claiming that the other 1023 GB is in use.

Thanks alot for Perderabo for the detailed explaination, that really clears up everything. Cheers!