top oddities with memory

top oddities with memory

Post by Ian Didda » Thu, 03 Jul 2003 01:15:46



a user asked me about the following today and I admit I haven't a
clue.

Running "top" on a box (redhat FWIW) gave bizarre memory figues when
compared.

The user wrote

I just looked at the three underlined  values below.  I just assumed
that all processes below the one at 9728 (and including that one too)
were actually using 10000 (which is conservative).  So that would be
73 process at 10M is 730M plus 581M, 69M, 14M, 11M and 9.9M which is
only 1414.9M (the actual sum would be a lot lower than this
conservative estimate).  But "top" says 2273672K are being used."

  4:46pm  up 4 days,  4:30,  4 users,  load average: 0.16, 0.17, 0.33
_78_ processes: 77 sleeping, 1 running, 0 zombie, 0 stopped
CPU0 states:  0.0% user,  0.2% system,  0.0% nice, 99.3% idle
CPU1 states:  0.1% user,  0.0% system,  0.0% nice, 99.4% idle
Mem:  3955776K av, _2273672K_ used, 1682104K free,       0K shrd,
117056K buff
Swap: 4194224K av,   12028K used, 4182196K free                
1417596K cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
17531 sjr       15   0  581M 581M  8324 S     0.0 15.0   7:49
fm_shell_exec
17548 sjr       15   0 71532  69M  5596 S     0.0  1.8   0:06 fmg
 8069 sjr       15   0 14348  14M  4328 S     0.0  0.3   0:11 xemacs
22291 mhb       15   0 11908  11M  9208 S     0.1  0.3   0:01 konsole
31818 sjr       15   0 10160 9.9M  4348 S     0.0  0.2   0:06 xemacs
22347 mhb       15   0  9732 _9728_  8864 S     0.0  0.2   0:55
kdeinit
22345 mhb       15   0  8056 8052  7692 S     0.0  0.2   0:00 kdeinit
22342 mhb       15   0  7644 7640  7332 S     0.0  0.1   0:00 kdeinit
32738 mdr       15   0  7508 7508  2060 S     0.0  0.1   0:00 xterm
22339 mhb       15   0  7376 7372  7068 S     0.0  0.1   0:00 kdeinit
25816 npp       15   0  3044 3044  1292 S     0.0  0.0   0:02
RunHwSim.pl
11495 npp       15   0  3012 3012  1292 S     0.0  0.0   0:00
RunHwSim.pl
 1415 root      15   0  3464 2176  1816 S     0.0  0.0   5:27
kdm_greet
30878 sjr       15   0  2144 2144  1124 S     0.0  0.0   0:00 csh
  870 ntp       15   0  1876 1876  1812 S     0.0  0.0   0:10 ntpd
 1342 sge        5 -10  1708 1656  1180 S <   0.0  0.0  13:02
sge_execd
32741 mdr       15   0  1552 1552   828 S     0.0  0.0   0:00 csh
11262 npp       22   0  1476 1476   836 S     0.0  0.0   0:00 csh
25573 npp       22   0  1472 1472   836 S     0.0  0.0   0:00 csh
22350 mhb       15   0  1464 1464   812 S     0.0  0.0   0:00 csh
19182 root      15   0  1372 1372   984 S     0.0  0.0   0:00 login
 1131 root      15   0  1812 1348  1256 S     0.0  0.0   0:09 sendmail
19223 root      15   0  1296 1296  1020 S     0.0  0.0   0:00 bash
 1409 root      15   0 14872 1288   872 S     0.0  0.0  20:09 X
19183 admin     15   0  1288 1288  1020 S     0.0  0.0   0:00 bash
30877 root      16   0  1192 1192   968 S     0.0  0.0   0:00 login
23294 mhb       15   0  1188 1188   956 R     0.3  0.0   0:00 top
19222 root      15   0  1176 1176   836 S     0.0  0.0   0:00 su
 1344 root      15   0  1156 1068   988 S     0.0  0.0   0:04 licsense
30876 root      15   0  1048 1048   832 S     0.0  0.0   0:00
in.rlogind
17513 sjr       15   0  1028 1028   868 S     0.0  0.0   0:00
formality
 1340 root      15   0   940  912   776 S     0.0  0.0   0:44
sge_commd
 1072 root      15   0   920  824   740 S     0.0  0.0   0:00 xinetd
 1029 root      16   0  1024  816   816 S     0.0  0.0   0:00 sshd
25572 sge        5 -10   784  784   632 S <   0.0  0.0   0:00
sge_shepherd
11261 sge        5 -10   784  784   632 S <   0.0  0.0   0:00
sge_shepherd
19181 root      15   0   744  744   616 S     0.0  0.0   0:00
in.telnetd
 1244 xfs       15   0  3844  740   684 S     0.0  0.0   0:00 xfs
  893 root      18   0   760  700   632 S     0.0  0.0   0:00 ypbind
  895 root      15   0   760  700   632 S     0.0  0.0   0:02 ypbind
  896 root      20   0   760  700   632 S     0.0  0.0   0:00 ypbind
  897 root      15   0   760  700   632 S     0.0  0.0   0:01 ypbind

any ideas?  are we missing somethingbblindingly obvious (or is top
just unreliable for memory stats?)

ian

 
 
 

top oddities with memory

Post by Steve Cousin » Fri, 04 Jul 2003 01:13:05



> any ideas?  are we missing somethingbblindingly obvious (or is top
> just unreliable for memory stats?)

It is counting the cached data too.  As soon as a program needs the
memory it will give it up but until then it will keep recently used data
in memory in case it is asked for again, thus giving a performance boost
over reading from disk.

_____________________________________________________________

 Research Associate           Phone: (207) 581-4302
 Ocean Modeling Group          
 School of Marine Sciences    208 Libby Hall,
 University of Maine          Orono ME 04469

 
 
 

top oddities with memory

Post by Doug Freyburg » Fri, 04 Jul 2003 03:03:01



> I just looked at the three underlined  values below.  I just assumed
> that all processes below the one at 9728 (and including that one too)
> were actually using 10000 (which is conservative).  So that would be
> 73 process at 10M is 730M plus 581M, 69M, 14M, 11M and 9.9M which is
> only 1414.9M (the actual sum would be a lot lower than this
> conservative estimate).  But "top" says 2273672K are being used."

Of the physical memory not used by any processes, the kernel uses most
of it to buffer filesystem blocks.  Directories, inodes, superblocks,
you name it.  The more the merrier to improve filesystem throughput.
The target usage is to bring the total used to around 90% of physical
memory.
 
 
 

1. free(8050000) above top of memory. Memory corrupt?

Hi,

I'm suddenly getting the following messages:

free(8050000) above top of memory. (memtop = 804f000 membot = 8049fb8)

I never got these messages before, and as far as I know I didn't change
anything on my system lately. I suspect faulty SIMMs. Is it possible
to get this message cause of that. Anyone got any ideas about this? My
setup is:

- Linux 1.3.59
- CPU: 486DX2-66
- 16 Mb RAM

Thanks for any pointers.

Ben.

2. Any programing environments for Linux? Suggestions Please.

3. Squid Setting IP Forward (Top Top Top Urgent)

4. access to 2s SCSI card

5. Oddities after memory addition

6. Kernel Compile Perplexities 3.2

7. memory usage from top

8. what desk manager is hot and what is not?

9. Freeware top incorrectly reporting amount of memory.

10. Question about "top" and memory usage

11. HELP! Top & Memory Usage Discrepancy

12. memory reported by dmesg and top does not agree with physical mem

13. top/free strangeness and cached memory