My question is why it is consuming that much of RAM. Can anyone help me to get it on this.
Whenever you read a file, it goes into the disk cache, it stays there until you delete the file or memory pressure causes it to be evicted. This means that once your machine has read 32 GB of disk space (since booting) you should expect it to have all the memory used for something.
The question you should be asking is why is some memory unused. Most likely because programs were started and later stopped. Also the OS tries to keep a portion of memory free for sudden memory allocations like starting a program. About 1 – 2 GB free seems reasonable.
In top you can see that 7 GB is for “cached” files and 0.5 GB is for buffers. Your JVM is using 1.6 GB of resident memory. The rest is being used by the OS and other programs.
If you want to see a break down of memory use run less /proc/meminfo
MemTotal: 8077800 kB
MemFree: 2925896 kB
Buffers: 161072 kB
Cached: 2282792 kB
Active: 3714312 kB
Inactive: 1148840 kB
Note: that while I am actively using ~ 3.7 GB, a further 2.2 GB is used for caching files.
A trick I use to see how much memory is really being used is to force memory out. e.g.
dd if=/dev/zero of=/tmp/deleteme bc=1000000 count=24000
rm /tmp/dleteme
This will create a 24 GB file and delete it. This will show you how much memory is really needed when you run top. I picked 24 GB as it’s about 75% of main memory.
solved RAM Utilization [closed]