Where is my memory going? (Debian NFS & PostgreSQL server)

From: Roy Hills (royhills_at_hotmail.com)
Date: 03/22/04


Date: Mon, 22 Mar 2004 11:38:35 +0000

I'm running a Debian "Woody" system with 2.4.24 kernel which is acting as
an NFS file server (using Kernel NFS support) and a PostgreSQL database
server. I have 256MB RAM in this system, which is correctly detected by
the Kernel.

I can't work out where all the memory is being used, because if I subtract
the RSS sizes of all processes (from "ps aux") from 256MB, I get an answer
which is _much_ bigger than I get from "free", even after I adjust for
buffers and cache.

I suspect that the Kernel NFS server is using the memory, but I can't find
how to prove this, or how to get the NFS server to report its usage. The
nfsd processes show zero RSS in a ps listing.

Here's an example:

In summary:

"free" reports 257,096KB total and 35,196KB Free
The sum of the process RSS values is only 18,292KB
Hence I would expect to see 257,096-18,292 = 238,804 KB Free

Here are the details:

rsh@neon [522]$ free
             total used free shared buffers cached
Mem: 257096 252840 4256 0 7800 23140
-/+ buffers/cache: 221900 35196
Swap: 581912 4868 577044

rsh@neon [523]$ dmesg
Linux version 2.4.24 (root@neon) (gcc version 2.95.4 20011002 (Debian
prerelease)) #2 Sun Feb 22 12:49:11 GMT 2004
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
 BIOS-e820: 0000000000100000 - 000000000fff0000 (usable)
 BIOS-e820: 000000000fff0000 - 000000000ffffc00 (ACPI data)
 BIOS-e820: 000000000ffffc00 - 0000000010000000 (reserved)
 BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)
 BIOS-e820: 00000000fee00000 - 00000000fee10000 (reserved)
 BIOS-e820: 00000000fff80000 - 0000000100000000 (reserved)
255MB LOWMEM available.
...
Memory: 256840k/262080k available (1179k kernel code, 4856k reserved, 345k
data, 256k init, 0k highmem)
...

rsh@neon [525]$ COLUMNS=75 ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 1272 72 ? S Mar05 0:03 init [2]
root 2 0.0 0.0 0 0 ? SW Mar05 0:00 [keventd]
root 3 0.0 0.0 0 0 ? SWN Mar05 0:00 [ksoftirqd_C
root 4 0.0 0.0 0 0 ? SW Mar05 15:24 [kswapd]
root 5 0.0 0.0 0 0 ? SW Mar05 0:02 [bdflush]
root 6 0.0 0.0 0 0 ? SW Mar05 0:01 [kupdated]
root 7 0.0 0.0 0 0 ? SW< Mar05 0:00 [mdrecoveryd
root 8 0.0 0.0 0 0 ? SW< Mar05 0:00 [raid1d]
root 9 0.0 0.0 0 0 ? SW< Mar05 0:00 [raid1d]
root 10 0.0 0.0 0 0 ? SW< Mar05 0:00 [raid1d]
root 11 0.0 0.0 0 0 ? SW Mar05 0:00 [kjournald]
root 75 0.0 0.0 0 0 ? SW< Mar05 0:00 [raid1d]
root 100 0.0 0.0 0 0 ? SW Mar05 0:00 [kjournald]
root 101 0.0 0.0 0 0 ? SW Mar05 1:36 [kjournald]
root 102 0.0 0.0 0 0 ? SW Mar05 1:49 [kjournald]
root 103 0.0 0.0 0 0 ? SW Mar05 0:00 [kjournald]
daemon 125 0.0 0.1 1388 272 ? S Mar05 0:00 /sbin/portma
root 218 0.0 0.0 2024 220 ? S Mar05 0:09 /sbin/syslog
root 221 0.0 0.0 2032 4 ? S Mar05 0:00 /sbin/klogd
root 225 0.0 0.0 1444 4 ? S Mar05 0:00 /sbin/rpc.st
root 231 0.0 0.0 1988 4 ? S Mar05 0:00 /usr/sbin/in
root 240 0.0 0.0 0 0 ? SW Mar05 0:18 [nfsd]
root 241 0.0 0.0 0 0 ? SW Mar05 0:20 [nfsd]
root 242 0.0 0.0 0 0 ? SW Mar05 0:21 [nfsd]
root 243 0.0 0.0 0 0 ? SW Mar05 0:00 [lockd]
root 244 0.0 0.0 0 0 ? SW Mar05 0:00 [rpciod]
root 245 0.0 0.0 0 0 ? SW Mar05 0:16 [nfsd]
root 246 0.0 0.0 0 0 ? SW Mar05 0:18 [nfsd]
root 247 0.0 0.0 0 0 ? SW Mar05 0:20 [nfsd]
root 248 0.0 0.0 0 0 ? SW Mar05 0:20 [nfsd]
root 249 0.0 0.0 0 0 ? SW Mar05 0:17 [nfsd]
root 252 0.0 0.1 1540 500 ? S Mar05 0:00 /usr/sbin/rp
mail 255 0.0 0.0 1696 140 ? S Mar05 0:00 /usr/sbin/nu
postgres 293 0.0 0.0 8544 172 ? S Mar05 0:04 /usr/lib/pos
root 303 0.0 0.1 2724 464 ? S Mar05 0:10 /usr/sbin/nm
root 305 0.0 0.1 3572 276 ? S Mar05 0:00 /usr/sbin/sm
root 308 0.0 0.2 3776 612 ? S Mar05 0:06 /usr/sbin/sn
root 314 0.0 0.1 2780 304 ? S Mar05 0:07 /usr/sbin/ss
root 323 0.0 0.7 1976 1968 ? SL Mar05 0:00 /usr/sbin/nt
daemon 326 0.0 0.0 1384 52 ? S Mar05 0:00 /usr/sbin/at
root 329 0.0 0.0 1652 168 ? S Mar05 0:00 /usr/sbin/cr
root 332 0.0 0.0 1252 4 tty1 S Mar05 0:00 /sbin/getty
root 333 0.0 0.0 1252 4 tty2 S Mar05 0:00 /sbin/getty
root 3881 0.0 0.5 3864 1312 ? S Mar18 0:00 /usr/sbin/sm
root 19061 0.0 0.4 3848 1276 ? S 08:50 0:00 /usr/sbin/sm
root 19064 0.0 0.3 3840 948 ? S 08:53 0:00 /usr/sbin/sm
root 19068 0.0 0.3 3848 920 ? S 09:02 0:00 /usr/sbin/sm
root 19069 0.0 0.4 3848 1120 ? S 09:04 0:00 /usr/sbin/sm
root 20306 0.0 0.6 6328 1660 ? S 10:30 0:00 /usr/sbin/ss
rsh 20308 0.0 0.6 6340 1736 ? S 10:30 0:00 /usr/sbin/ss
rsh 20309 0.0 0.4 2232 1276 pts/0 S 10:30 0:00 -bash
nobody 20427 0.0 0.5 3848 1288 ? S 11:27 0:00 /usr/sbin/sm
rsh 20435 4.0 0.5 3512 1516 pts/0 R 11:28 0:00 ps aux

rsh@neon [538]$ uptime
 11:35:49 up 16 days, 19:12, 1 user, load average: 0.00, 0.04, 0.01

Any ideas?

Roy



Relevant Pages

  • Where is my memory going? (2.4.24 Kernel NFS server)
    ... PostgreSQL database server. ... I suspect that the Kernel NFS server is using the memory, ... nfsd processes show zero RSS in a ps listing. ... neon# uname -a ...
    (Linux-Kernel)
  • Re: NFS mounts and following soft links
    ... I did a test on the kernel nfs server, and the bindmount is not shared, only ... I really don't want samba clients on ...
    (comp.os.linux.misc)
  • Re: Copy within the NFS partition
    ... because when I used to drag a folder containing squillion ... lan lights used to flash on the hub as the files were dragged across. ... so you weren't saying "this is different for kernel NFS servers" ... In any event, in this case, a user-space NFS server will avoid sending ...
    (comp.os.linux.networking)
  • Re: NFS stopped working [SOLVED]
    ... Sounds like rpc.mountd is not running on the server. ... 100005 1 udp 1023 mountd ... You may have to restart the kernel NFS services: ...
    (Ubuntu)
  • RE: RSS Appears to stall ? (Part 2 of 2)
    ... Local server type: RSS ... Connection status: Connected ... Buffer bufused bufsize numrecs numpages numwrits recs/pages ...
    (comp.databases.informix)