System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Linux kernel free mem usage clarification

skt_skt
Honored Contributor

Linux kernel free mem usage clarification


Red Hat Enterprise Linux AS release 3 (Taroon Update 9)

Linux hostname 2.4.21-53.ELsmp #1 SMP Wed Nov 14 03:54:12 EST 2007 i686 i686 i386 GNU/Linux


# free -mt
total used free shared buffers cached
Mem: 10024 10004 19 0 61 8540
-/+ buffers/cache: 1401 8622
Swap: 4095 218 3877
Total: 14120 10223 3897

getting following messages while doing "service nfd start". nfsd is failed to start.

Feb 12 17:14:56 shdbl2p nfs: Starting NFS services: succeeded
Feb 12 17:14:56 shdbl2p nfs: rpc.rquotad startup succeeded
Feb 12 17:14:56 shdbl2p nfsd[16431]: nfssvc: Cannot allocate memory
Feb 12 17:14:56 shdbl2p nfs: rpc.nfsd startup failed
Feb 12 17:14:56 shdbl2p nfs: rpc.mountd startup succeeded

This memory error looks contradictory my understanding on the LINUX free memmory (MEM free=free+ cached)calculation. As of now i hav 8GB under cached.

Could some one explain? OR is understaning wrong free mem?
10 REPLIES
Ivan Ferreira
Honored Contributor

Re: Linux kernel free mem usage clarification

I think that there should be another problem. I'm reading the free command as you are, but anyway, the system should report out of memory only when RAM + SWAP is consumed totally. This is not the case.

Maybe, some kernel parameter or shell limit is in place.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: Linux kernel free mem usage clarification

Shalom,

nfslock service may not be running. That could cause this problem.

You have sufficient memory.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Matti_Kurkela
Honored Contributor

Re: Linux kernel free mem usage clarification

You're running a 32-bit kernel on a server that has multiple gigabytes of memory. There are two limits in that:

- the design limit of 32-bit Linux memory management: the standard maximum userspace size without any highmem workarounds is "1 GB minus all memory-mapped hardware (like VideoRAM of the display adapter)".

- a 32-bit processor simply cannot directly access more than 4 GB: it does not have enough bits on its address bus for that. A workaround is PAE, which is essentially a form of bank-switching.

The side effect of the combination of these workarounds is that all memory is not equal. The first 1 GB or so of the memory is considered "low" memory. The rest is "high" memory. For some purposes (like I/O buffers), high memory is not usable: low memory must be used.

(For example, to transfer data from one segment of high memory to another, the system may need to copy it from the source location to low memory, then switch high memory banks and copy the data from low memory to the target segment.)

It is possible to run out of low memory while still having plenty of high memory. I have a suspicion this is happening in your case.

Please run:
egrep 'High|Low' /proc/meminfo

to see your high/low memory situation.

If your workload demands more than 1 GB of low memory, I'm afraid the only solution is to upgrade to a 64-bit version of the OS.

For quite a while, I've been following this policy: if a new server is installed with more than 2 GB of memory or it seems likely that its memory will be expanded beyond that limit in the foreseeable future, I'd strongly recommend installing a 64-bit version of the OS from the beginning.

MK
MK
skt_skt
Honored Contributor

Re: Linux kernel free mem usage clarification

starting nfslock did not make any diff.

# egrep 'High|Low' /proc/meminfo
HighTotal: 9567024 kB
HighFree: 18976 kB
LowTotal: 697836 kB
LowFree: 22064 kB

How can i check the cpu is 32bit?Just curious. I know my linux kernel is 32bit

Does nfsd uses high or low memory? In my case free is low on both cases.
Ivan Ferreira
Honored Contributor

Re: Linux kernel free mem usage clarification

I'm not sure of the 1 GB limitation on nowdays kernels. It's suppossed that a HIGHMEM enabled kernel can use all the system memory.

http://kerneltrap.org/node/2450
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
dirk dierickx
Honored Contributor

Re: Linux kernel free mem usage clarification

when run on a server, there is hardly any excuse for running the 32bit version on 64bit hardware.
JHKCMO
Occasional Advisor

Re: Linux kernel free mem usage clarification

Why not install and run the hugemem kernel? Doesn't that allow using the first 4GB as lowmem and the rest as highmem or is my understanding of that kernel off?
dirk dierickx
Honored Contributor

Re: Linux kernel free mem usage clarification

he must already be running hugemem otherwise he wouldn't be able to recognize all his ram.
JHKCMO
Occasional Advisor

Re: Linux kernel free mem usage clarification

Looks like uname is saying he's running on SMP:

Linux hostname 2.4.21-53.ELsmp #1 SMP

skt_skt
Honored Contributor

Re: Linux kernel free mem usage clarification

i dont see any issue in recongizing the high/low memory on the system. see the post above