[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 459
  • Last Modified:

All memory is used, but cant find the process thats using it

Hi,

 
Distro is : Red Hat Enterprise Linux Server release 6.2 (Santiago)

Here is my /proc/memnfo:
MemTotal:       16334688 kB
MemFree:          198172 kB
Buffers:           20564 kB
Cached:           146904 kB
SwapCached:        31912 kB
Active:          4507860 kB
Inactive:         637712 kB
Active(anon):    4391504 kB
Inactive(anon):   587792 kB
Active(file):     116356 kB
Inactive(file):    49920 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       6160376 kB
SwapFree:        5435248 kB
Dirty:               116 kB
Writeback:             0 kB
AnonPages:       4962748 kB
Mapped:            11984 kB
Shmem:              1188 kB
Slab:             101552 kB
SReclaimable:      69648 kB
SUnreclaim:        31904 kB
KernelStack:        2504 kB
PageTables:        20908 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    14327720 kB
Committed_AS:    7284856 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      304036 kB
VmallocChunk:   34359426780 kB
HardwareCorrupted:     0 kB
AnonHugePages:   3551232 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       10240 kB
DirectMap2M:    16766976 kB



I only have 1 java process that takes 30% of my memory, why does proc says  All my memoory is used?

Thanks
0
icongo
Asked:
icongo
1 Solution
 
icongoAuthor Commented:
I think I have found my  Not_Problem. All memory is used for disk caching.

Thanks to Linuxatemyram.com

Linux is borrowing unused memory for disk caching. This makes it looks like you are low on memory, but you are not! Everything is fine!

Why is it doing this?

Disk caching makes the system much faster! There are no downsides, except for confusing newbies. It does not take memory away from applications in any way, ever!

What if I want to run more applications?

If your applications want more memory, they just take back a chunk that the disk cache borrowed. Disk cache can always be given back to applications immediately! You are not low on ram!
Do I need more swap?

No, disk caching only borrows the ram that applications don't currently want. It will not use swap. If applications want more memory, they just take it back from the disk cache. They will not start swapping.
How do I stop Linux from doing this?

You can't disable disk caching. The only reason anyone ever wants to disable disk caching is because they think it takes memory away from their applications, which it doesn't! Disk cache makes applications load faster and run smoother, but it NEVER EVER takes memory away from them! Therefore, there's absolutely no reason to disable it!
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now