Question Regarding RAM Usage

Hello,

Sorry, but this just seems a bit odd to me and I am curious about it. It has not been a problem yet. I am running FreeBSD 8.0-RELEASE-p2 on a new 12-core 48GB machine. I am new to FreeBSD having used Solaris for many years, so I am not entirely clear on how FreeBSD uses its memory and how accurate top reports memory use.

That said, I am using kde4 as a desktop from the ports and just logging in yields findings similar to this (kmail & opera don't change things much):
[CMD=]top[/CMD]
Code:
last pid: 27833;  load averages:  0.05,  0.07,  0.07                                 up 1+22:05:51  12:26:52
127 processes: 1 running, 123 sleeping, 3 zombie
CPU:  0.2% user,  0.0% nice,  0.1% system,  0.0% interrupt, 99.7% idle
Mem: 523M Active, 323M Inact, 7621M Wired, 5996K Cache, 1448M Buf, 38G Free
Swap: 32G Total, 32G Free

  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
27533 aorchid       1  44    0 22140K  4068K select  0   0:01  0.49% mrxvt
 1239 root          1  44    0   879M 52400K select 15  33:58  0.00% Xorg
27462 aorchid       1  44    0   228M 69556K select  2   1:17  0.00% kdeinit4
27583 aorchid       6  44    0   371M   151M select 10   0:52  0.00% kmail
27509 aorchid       2  76    0   237M 76328K select  1   0:51  0.00% kdeinit4
27469 aorchid       1  44    0   458M 87824K select  1   0:46  0.00% kwin
27610 aorchid       3  48    0   153M   107M ucond   0   0:38  0.00% opera
10807 aorchid      12  44    0   143M 35688K ucond  14   0:24  0.00% mysqld
  693 root          1  44    0  7012K  1388K select  0   0:18  0.00% moused
27511 aorchid       1  44    0  6892K  2244K select 12   0:14  0.00% ksysguardd
 1244 haldaemon     1  44    0 24124K  5152K select  0   0:11  0.00% hald
27473 aorchid       2  63    0   451M    99M select 17   0:06  0.00% kdeinit4
27491 aorchid       1  44    0   441M 83900K select 10   0:03  0.00% kdeinit4
 1058 root          1  44    0 10836K  2564K select 14   0:02  0.00% ntpd
27501 aorchid       1  44    0   100M 27988K select  2   0:02  0.00% nepomukservicestub
  464 _pflogd       1  44    0  7080K  1748K bpf     0   0:02  0.00% pflogd
 1171 root          1  44    0 11056K  3920K select  0   0:01  0.00% sendmail
27715 aorchid       1  44    0   172M 53912K select  0   0:01  0.00% okular
27585 aorchid       1  44    0   200M 68676K select  6   0:01  0.00% kdeinit4
27587 aorchid       1  44    0   204M 64640K select 15   0:01  0.00% kdeinit4
 1120 messagebus    1  44    0  7064K  2376K select  5   0:01  0.00% dbus-daemon
27517 aorchid       3  44    0   217M 58328K kqread 12   0:01  0.00% kleopatra
27588 aorchid       1  44    0   203M 63160K select  1   0:01  0.00% kdeinit4
27744 aorchid       1  44    0 18512K  5228K pause   2   0:01  0.00% zsh
27459 aorchid       1  45    0   167M 53316K select 12   0:01  0.00% kdeinit4
27497 aorchid       1  44    0   126M 34144K select  6   0:00  0.00% nepomukservicestub
27589 aorchid       1  44    0   203M 62772K select 12   0:00  0.00% kdeinit4
27487 aorchid       2  76    0   234M 69084K select  6   0:00  0.00% kdeinit4
27536 aorchid       1  44    0 18328K  4996K ttyin  12   0:00  0.00% zsh
27453 aorchid       1  44    0  7064K  2560K select 17   0:00  0.00% dbus-daemon
27475 aorchid       4  44    0   269M 44932K ucond   2   0:00  0.00% knotify4
27528 aorchid       1  44    0   225M 65876K select 20   0:00  0.00% kdeinit4
 1181 root          1  44    0  6920K  1624K nanslp  0   0:00  0.00% cron
27558 aorchid       1  44    0   201M 44520K select 16   0:00  0.00% korgac
27499 aorchid       1  44    0   100M 27592K select 20   0:00  0.00% nepomukservicestub
27481 aorchid       1  44    0   195M 61964K select 20   0:00  0.00% kdeinit4
  886 root          1  44    0  5992K  1544K select 13   0:00  0.00% syslogd
27498 aorchid       2  76    0   101M 27552K ucond   0   0:00  0.00% nepomukservicestub
27471 aorchid       1  44    0   196M 62556K select  9   0:00  0.00% kdeinit4
27489 aorchid       2  76    0   221M 67188K select  1   0:00  0.00% kdeinit4
27468 aorchid       2  76    0   202M 62964K select  0   0:00  0.00% kdeinit4
27508 aorchid       1  44    0   198M 64716K select  0   0:00  0.00% kdeinit4
27591 aorchid       1  44    0   198M 59712K select  0   0:00  0.00% kdeinit4
27460 aorchid       1  44    0   172M 58104K select 12   0:00  0.00% kdeinit4
 1247 root         17  55    0 31428K  5216K waitvt 12   0:00  0.00% console-kit-daemon
27827 aorchid       1  47    0   186M 60188K select 12   0:00  0.00% kdeinit4
 1175 smmsp         1  44    0 11056K  3716K pause   1   0:00  0.00% sendmail
27689 aorchid       1  44    0   172M 57852K select 16   0:00  0.00% kdeinit4
 1270 root          1  44    0 15760K  2956K select  3   0:00  0.00% hald-runner
 1236 root          1  44    0 17928K  2308K select  0   0:00  0.00% kdm-bin
27408 aorchid       1  76    0  7232K  1940K wait   14   0:00  0.00% sh
  720 root          1  44    0  2180K   652K select  0   0:00  0.00% devd
27395 root          1  46    0 26524K  3252K pause  12   0:00  0.00% kdm-bin
 1295 root          1  76    0 18688K  2704K kqread 12   0:00  0.00% hald-addon-mouse-sy
 1299 root          1  76    0 18688K  2704K kqread 12   0:00  0.00% hald-addon-mouse-sy
10791 aorchid       1  76    0  7232K  1956K wait   14   0:00  0.00% sh
 1228 root          1  76    0  5860K  1296K ttyin  12   0:00  0.00% getty
 1234 root          1  76    0  5860K  1296K ttyin   6   0:00  0.00% getty
 1231 root          1  76    0  5860K  1296K ttyin   4   0:00  0.00% getty
 1230 root          1  76    0  5860K  1296K ttyin  14   0:00  0.00% getty
 1232 root          1  76    0  5860K  1296K ttyin  16   0:00  0.00% getty
 1235 root          1  76    0  5860K  1296K ttyin  18   0:00  0.00% getty
27439 aorchid       1  49    0  7064K  2100K select 12   0:00  0.00% dbus-daemon

This seems like a lot of RAM going toward kde4 without it really doing anything. Likewise, system monitor states 'Memory 8.3 GiB / 48 Gib'. Would this be considered normal or is the shared memory between processes not being accurately accounted for.

Thanks,
 
FreeBSD's device on memory is: "Free memory is wasted memory."

If You wold be running this on 2GB system, it will use a lot less RAM, but while You have plenty of RAM available, its pointless to release that data from RAM just to have more 'free' memory in stats. Like all today's OSes FreeBSD caches everything it 'thinks' may be usable later for anything, because it speeds up things. Also do not thing that using SWAP while have that many RAM is bad, since FreeBSD may use 'a little' of SWAP for data that may not be as that vital, but SWAP is the place not as precious as RAM, so they may 'lay' there.

Generally FreeBSD is very light if it comes to memory usage, at least without ZFS of course, I was able to setup a clean FreeBSD install on 28MB RAM box and I was able to cut it even to 24MB without rebuilding the kernel (rebuilt kernel with only the drivers that You will need will permit using even 18MB of RAM propably).

Also % top -b -o res command is good way to start tracking 'memory hogs', but remember that KDE4.x is a memory hog anyway, so not much to save here unforutnelly.

About your output, all this RAM is alocated by KDE4.x (specially kmail looks 'nice'):

Code:
  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
27511 aorchid       1  44    0  6892K  2244K select 12   0:14  0.00% ksysguardd
 1236 root          1  44    0 17928K  2308K select  0   0:00  0.00% kdm-bin
27395 root          1  46    0 26524K  3252K pause  12   0:00  0.00% kdm-bin
27558 aorchid       1  44    0   201M 44520K select 16   0:00  0.00% korgac
27475 aorchid       4  44    0   269M 44932K ucond   2   0:00  0.00% knotify4
27459 aorchid       1  45    0   167M 53316K select 12   0:01  0.00% kdeinit4
27715 aorchid       1  44    0   172M 53912K select  0   0:01  0.00% okular
27689 aorchid       1  44    0   172M 57852K select 16   0:00  0.00% kdeinit4
27460 aorchid       1  44    0   172M 58104K select 12   0:00  0.00% kdeinit4
27517 aorchid       3  44    0   217M 58328K kqread 12   0:01  0.00% kleopatra
27591 aorchid       1  44    0   198M 59712K select  0   0:00  0.00% kdeinit4
27827 aorchid       1  47    0   186M 60188K select 12   0:00  0.00% kdeinit4
27481 aorchid       1  44    0   195M 61964K select 20   0:00  0.00% kdeinit4
27471 aorchid       1  44    0   196M 62556K select  9   0:00  0.00% kdeinit4
27589 aorchid       1  44    0   203M 62772K select 12   0:00  0.00% kdeinit4
27468 aorchid       2  76    0   202M 62964K select  0   0:00  0.00% kdeinit4
27588 aorchid       1  44    0   203M 63160K select  1   0:01  0.00% kdeinit4
27587 aorchid       1  44    0   204M 64640K select 15   0:01  0.00% kdeinit4
27508 aorchid       1  44    0   198M 64716K select  0   0:00  0.00% kdeinit4
27528 aorchid       1  44    0   225M 65876K select 20   0:00  0.00% kdeinit4
27489 aorchid       2  76    0   221M 67188K select  1   0:00  0.00% kdeinit4
27585 aorchid       1  44    0   200M 68676K select  6   0:01  0.00% kdeinit4
27487 aorchid       2  76    0   234M 69084K select  6   0:00  0.00% kdeinit4
27462 aorchid       1  44    0   228M 69556K select  2   1:17  0.00% kdeinit4
27509 aorchid       2  76    0   237M 76328K select  1   0:51  0.00% kdeinit4
27491 aorchid       1  44    0   441M 83900K select 10   0:03  0.00% kdeinit4
27469 aorchid       1  44    0   458M 87824K select  1   0:46  0.00% kwin
27473 aorchid       2  63    0   451M    99M select 17   0:06  0.00% kdeinit4
27583 aorchid       6  44    0   371M   151M select 10   0:52  0.00% kmail
 
there is also the port
/freecolor/ which may more accurately depict
whether your system is actually slow(ed)(ing) down
due to X, port builds, browser page size, etc.
and works in either an eterm, xterm, aterm or
the console.
 
Thank you both very much for your reply. I see the point of using the memory now. If it becomes an issue while getting real work done :p , I'll check back in.
thanks
 
aorchid said:
Thank you both very much for your reply. I see the point of using the memory now. If it becomes an issue while getting real work done :p , I'll check back in.
thanks
Hello, hemmm, just curious: considering I do run your same OS on a machine with 688 MB ram and KDE 4.4.4 and I can say for normal desktop use it runs pretty flawlessly (in this very moment I do run: Firefox with 5 tabs, two terminals, Pidgin, one Dolphin window, Amarok playin a song) and everything runs smooth.

My actual Top command say: 76 tasks running, load av 2.05 1.79 1.20, Mem: 467M Active, 48M Inact, 100M Wired, 18M Cache, 77M Buf, 29M Free, Swap: 1943M Total, 228M Used, 1714M Free, 11% Inuse

Now I'm wondering, considering my experience, whats the point of 48 gigs ram on a desktop Freebsd machine?

Just curious, no flame. thankx.
 
I have to say that I am more than a little surprised that KDE is that lightweight, but that's great for you.

I use the machine for computational work and I wanted all computation to be performed in RAM for speed and the work is also graphically intense. I was tired on X crashing from RAM being used up and also wanted to get other work done as the computations took place so I went crazy with the RAM.
 
Back
Top