On 13/06/2013 10:14, Grant wrote:
> I'm trying to maximize the number of servers I can run on my machine
> without running out of physical RAM.  I noticed something strange when
> comparing top and free statistics:
> 
> top says each PID associated with a particular server has a RES of
> about 100M.  Does that mean each running instance of that server
> reserves 100MB?  Since there are 20 of these servers running, this
> seems contradictory to the output from free which indicates less than
> 1GB used -/+ buffers/cache.

RES does not mean reserved. It means resident.

"man top" and searhc for RES for more info

> 
> Is there any way to monitor RAM usage over time to see how close I'm
> getting to using all of my physical RAM?


Not really if instantaneous values is what you are looking for.

All tools that purport to display "memory used" and "cpu load" values on
an instantaneous basis basically lie through their teeth, and it's a
fallacy to try and interpret such results to gain anything meaningful.

It can't be any other way actually - memory usage can change
dramatically 10,000 times a second, and that is precisely what the
computer is designed to do, and to do it fast, and to do it invisibly.

"using all of my physical RAM" is also a concept that really makes no
sense in any meaningful way. You can't treat it like eg the amount of
water left in a bottle. All of memory is always in use all of the time,
it's always doing *something*. Most of it is under the kernel's control
and is used for caching, and the kernel is free to move things around as
it sees fit. Memory is also shared, you can easily have a situation
where 10 apps each have access to Y megs of RAM and total memory in use
is still only a little bit more than Y

The best you can really do is keep an eye on what free says, and to
graph the trend.




-- 
Alan McKinnon
[email protected]


Reply via email to