Memory Question
-
When I log in via putty and the statistics page comes up it says the memory usage is about 10%. Yet when I run TOP, it was 4046992 Total, 381886 Used, xxxxx Free.
Can someone explain why one says on 10% and the other basically maxed? I am trying to figure if I need to add more RAM or not.
Thanks.
-
-
10% of 4046992 = 404699.2
381886/4046992 = 0.094362962…
My guess is it’s rounding up to the nearest.
-
Also what is up with Zombie Processes?
-
@adukes40 https://en.wikipedia.org/wiki/Zombie_process
10% is not much usage. I don’t understand what the post is looking for. -
Top says maybe 10% is free, with 3.9 total and 3.6 used.
-
In the free -h screen you see, it shows you have about 10% memory available, but… linux doesn’t just keep memory cleaned up all the time as it’s more resource intensive to load process to ram, send to cpu, and clear the ram once cpu is done. Often times the same cycles of memory are in use so the data that’s being called get’s put into a cached state.
(the Cached 3.1G you see on the free screen).
This doesn’t mean you only have about 224M free to use, it just means the current unused RAM is 224M.
If a process needs more ram, Linux will clear up the space it needs. If you’re still really concerned about this you can temporarily clear the cache with:
sync; echo 3>|/proc/sys/vm/drop_caches; sync; echo 0 >|/proc/sys/vm/drop_caches
-
@Tom-Elliott AHH, Ok. thanks Tom. I did not know that it was caching that. I was baffled at why it was always maxed, when actually it is not. Basically, adding more memory would just allow for more cached processes to be kept?
-
@adukes40 From what I gather, yes. And more ram = more caching = good.
-
@adukes40 I suppose yes. What you should be concerned with in regards to memory is if you see a lot of stuff moving in out out of SWAP space.