Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linux Memory Utilization/Management

Status
Not open for further replies.

mvvilleza

MIS
Nov 23, 2000
114
PH
Hi everyone,

I just installed a RedHat 9 server where on the components selection, i choosed to install Development tools and removed Text based internet, Windows File Server and another one i cannot remember but definitely not needed in my configuration.

I have a Celeron 300 PC w/ 64 MB memory. Partitioned my 4 GB hard disk to 100 MB of /boot partition, 128-256 MB swap and the rest for /. I used this PC as a RAS server and installed an Equinox SST adapter w/ a 16 port module but as of now we're just using 8 ports bec. i'm currently sizing up the server. I installed mgetty included in the RedHat 9 CD and ppp-2.4.3.

Here's the question: I noticed that w/o any load or dialup connections my free memory is about 32 MB. After 8 dial up connections are accepted, the free memory reduced up to 8 MB and while the connections are released the 8 MB free memory does not change. But after i restarted Linux the free memory was back to 32 MB.

Is this behaviour natural on Linux or for PPP only? How does Linux utilize/manages memory?
 
In the best way it can.. unneeded ram it can reuse for stuff as file / system buffers/caches.. in the end so to say its never clever to leave unneeded ram really untouched. Also, if you read that by top or free without any math'ing, you may notice some extra buffers or such.
A test would be to boot it new, cat /usr/bin/* >/dev/null, and see that the free usage is gone again, where it isnt really gone. (this way with enough ram you can have whole GBs cached for extensive usage)

This snipped shows 'real' free usage, named 'x_free'
Code:
#/bin/sh

# display real ram free usage

free | awk '/Mem:/ {
            free = ($2 - $3) + $(NF - 1) + $NF
            ratio = free / $2 * 100
            printf "ram:  %.2fMB Free - %.2f%%\n", free / 1024, ratio
    }
    /Swap:/ {
            ratio = $4 / $2 * 100
            printf "swap: %.2fMB Free - %.2f%%\n", $4 / 1024, ratio
    }'

. Mac for productivity
.. Linux for developement
... Windows for solitaire
 
Linux memory caching has become more aggressive.
Most distributions have some tweaks in there as well.

Unless performance suffers or a lot of swap(disk thrashing)
is occurring I wouldn't worry about it. Furthermore I would
suspect that you need to ulimit this process.
man setrlimit.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top