Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Linux likes RAM a bit too much?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
mani-man
n00b
n00b


Joined: 24 Jun 2003
Posts: 68

PostPosted: Mon Jan 05, 2004 1:07 pm    Post subject: Linux likes RAM a bit too much? Reply with quote

Hi!

I'm now testing gentoo and linux for the second time. =)

One thing i notice that's a bit different from OpenBSD, which I use when I'm not on Linux, is that Linux consumes a lot RAM. I use the same machine, and the same setup (X11 with fluxbox etc), but on OpenBSD, the memory usage is about 300MB, while it's on Linux is 512MB and some virtual memory is used as well.

Is this normal? It doesnt look like theres any memory leakage, since the memory usage is stable. I really don't like that Linux uses the virtual memory, since I have to suffer from the fact that some swapping takes place now and then.

br
m
Back to top
View user's profile Send private message
hifi
Apprentice
Apprentice


Joined: 17 Jul 2002
Posts: 184
Location: Graz

PostPosted: Mon Jan 05, 2004 1:17 pm    Post subject: Re: Linux likes RAM a bit too much? Reply with quote

mani-man wrote:
Hi!

I'm now testing gentoo and linux for the second time. =)

One thing i notice that's a bit different from OpenBSD, which I use when I'm not on Linux, is that Linux consumes a lot RAM. I use the same machine, and the same setup (X11 with fluxbox etc), but on OpenBSD, the memory usage is about 300MB, while it's on Linux is 512MB and some virtual memory is used as well.

Is this normal? It doesnt look like theres any memory leakage, since the memory usage is stable. I really don't like that Linux uses the virtual memory, since I have to suffer from the fact that some swapping takes place now and then.

br
m


Indeed the memory management from bsd is better ....

But I think there is somethin wrong, because

Code:

bash-2.05b$ cat /proc/meminfo
        total:    used:    free:  shared: buffers:  cached:
Mem:  526192640 184872960 341319680        0 17027072 81514496
Swap: 1077469184        0 1077469184
MemTotal:       513860 kB
MemFree:        333320 kB
MemShared:           0 kB
Buffers:         16628 kB
Cached:          79604 kB
SwapCached:          0 kB
Active:         145516 kB
ActiveAnon:      51960 kB
ActiveCache:     93556 kB
Inact_dirty:      1200 kB
Inact_laundry:       0 kB
Inact_clean:      1476 kB
Inact_target:    29636 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       513860 kB
LowFree:        333320 kB
SwapTotal:     1052216 kB
SwapFree:      1052216 kB


As you can see no swap is used (Mozilla windowmaker (ofcourse X11) )
Linux does heavy caching. and maybe, in a moment, when you used very much ram (eg emerge) something has went to swap, and is never used since then. .....

you can try to swapoff and swaponn again, and then no swap should be used if you don't do BIG things ....
Back to top
View user's profile Send private message
mani-man
n00b
n00b


Joined: 24 Jun 2003
Posts: 68

PostPosted: Mon Jan 05, 2004 1:26 pm    Post subject: Reply with quote

Ah, ok.

This is how my meminfo looks like:

Code:

MemTotal:       515304 kB
MemFree:          5888 kB
Buffers:         13580 kB
Cached:         201148 kB
SwapCached:      18700 kB
Active:         308456 kB
Inactive:       138516 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       515304 kB
LowFree:          5888 kB
SwapTotal:      497972 kB
SwapFree:       477320 kB
Dirty:              36 kB
Writeback:           0 kB
Mapped:         291072 kB
Slab:            49132 kB
Committed_AS:   373200 kB
PageTables:       1340 kB
VmallocTotal:   516076 kB
VmallocUsed:    137748 kB
VmallocChunk:   378192 kB


free:
Code:

             total       used       free     shared    buffers     cached
Mem:        515304     503208      12096          0      14284     193760
-/+ buffers/cache:     295164     220140
Swap:       497972      20632     477340



This occurs when I've been using my box for a couple of hours.
Back to top
View user's profile Send private message
georwell
Guru
Guru


Joined: 25 Jun 2003
Posts: 430
Location: Uppsala, Sweden

PostPosted: Mon Jan 05, 2004 1:37 pm    Post subject: Reply with quote

Linux always trys to use as much RAM as possible. As I understand it, If a process isn't using RAM then any free RAM is used for caching. I wouldn't say OpenBSD has better memory management just a different philosophy.
Back to top
View user's profile Send private message
luqas
Guru
Guru


Joined: 02 Jan 2004
Posts: 588
Location: /US/Texas/Beaumont

PostPosted: Mon Jan 05, 2004 1:47 pm    Post subject: Reply with quote

I just installed Gentoo last week and I am running KDE and I think my memory hovers around 200M or so. That is even after running for a couple of hours. And I don't use any Virtual (of course I am not taxing my machine that hard yet).
Back to top
View user's profile Send private message
vdboor
Guru
Guru


Joined: 03 Dec 2003
Posts: 592
Location: The Netherlands

PostPosted: Mon Jan 05, 2004 2:26 pm    Post subject: Reply with quote

Dryre wrote:
I just installed Gentoo last week and I am running KDE and I think my memory hovers around 200M or so. That is even after running for a couple of hours. And I don't use any Virtual (of course I am not taxing my machine that hard yet).


The KDE is a huge memory consumer. I often compare it with the Windows XP desktop in usage of memory. But I run the KDE desktop as well, because I like it's diversity. My machine had 265 megs of ram, and you can run KDE with it. I've upgraded to 512. This speeds up your entire machine.
...but if I open vmware with windows xp at the same time (and allow it to use 265 mb), most kde programs crash, because they are out of memory. ..which isn't that odd. :) Off course, this depends on the size of your swap partition as well. mine is just 128 mb.

Something like fluxbox, xfce4 (or twm :P) is a lot smaller, and uses less memory. I've been testing the memory usage of xfce4 in a vnc window, and it seamed to use 8 mb.
_________________
The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer

[ screenies | Coding on KMess ]
Back to top
View user's profile Send private message
mani-man
n00b
n00b


Joined: 24 Jun 2003
Posts: 68

PostPosted: Mon Jan 05, 2004 2:27 pm    Post subject: Reply with quote

georwell wrote:
Linux always trys to use as much RAM as possible. As I understand it, If a process isn't using RAM then any free RAM is used for caching. I wouldn't say OpenBSD has better memory management just a different philosophy.


I can understand that philosophy, but not when it includes using swap. That's a bit too Windows-ish for me.
Back to top
View user's profile Send private message
luqas
Guru
Guru


Joined: 02 Jan 2004
Posts: 588
Location: /US/Texas/Beaumont

PostPosted: Mon Jan 05, 2004 2:39 pm    Post subject: Reply with quote

vdboor wrote:
Dryre wrote:
I just installed Gentoo last week and I am running KDE and I think my memory hovers around 200M or so. That is even after running for a couple of hours. And I don't use any Virtual (of course I am not taxing my machine that hard yet).


The KDE is a huge memory consumer. I often compare it with the Windows XP desktop in usage of memory. But I run the KDE desktop as well, because I like it's diversity. My machine had 265 megs of ram, and you can run KDE with it. I've upgraded to 512. This speeds up your entire machine.
...but if I open vmware with windows xp at the same time (and allow it to use 265 mb), most kde programs crash, because they are out of memory. ..which isn't that odd. :) Off course, this depends on the size of your swap partition as well. mine is just 128 mb.

Something like fluxbox, xfce4 (or twm :P) is a lot smaller, and uses less memory. I've been testing the memory usage of xfce4 in a vnc window, and it seamed to use 8 mb.


Yea... 3/4 of my memory is for KDE, but I like it (of course I am a noob and haven't ventured to the other WM's). I am also running with 512.
Back to top
View user's profile Send private message
hifi
Apprentice
Apprentice


Joined: 17 Jul 2002
Posts: 184
Location: Graz

PostPosted: Mon Jan 05, 2004 2:43 pm    Post subject: Reply with quote

mani-man wrote:
georwell wrote:
Linux always trys to use as much RAM as possible. As I understand it, If a process isn't using RAM then any free RAM is used for caching. I wouldn't say OpenBSD has better memory management just a different philosophy.


I can understand that philosophy, but not when it includes using swap. That's a bit too Windows-ish for me.


Hmm, i see your argumentation, and i really think linux doesn't do so.
Mine doesn't ....

I think you did something powerfull were your swap was used. And because it isn't used since then linux rather uses the real mem for caching something used more than for taken the swap back, as you haven't used it anyway......


as you can see. nearly everything of your swap is cached, so it doesn't even need to use your harddrive if it want to access your swap ...
Back to top
View user's profile Send private message
Redeeman
l33t
l33t


Joined: 25 Sep 2003
Posts: 958
Location: Portugal

PostPosted: Mon Jan 05, 2004 2:55 pm    Post subject: Reply with quote

bsd doesent have better memory management, but i wouldnt say worse either, its different OS:s and it acts different.

some times its simply best to use swap even though you have enough free ram, and then cache the free ram.
Back to top
View user's profile Send private message
To
Veteran
Veteran


Joined: 12 Apr 2003
Posts: 1145
Location: Coimbra, Portugal

PostPosted: Mon Jan 05, 2004 2:58 pm    Post subject: Reply with quote

vdboor wrote:

Something like fluxbox, xfce4 (or twm :P) is a lot smaller, and uses less memory. I've been testing the memory usage of xfce4 in a vnc window, and it seamed to use 8 mb.


I run fluxbox for my vnc connection, small memory with a pretty look :wink:
Has memory usage Linux vs BSD well iptables vs pf I guess it's the biggest diference, iptables doing NAT is a RAM eater, but I can't complain about permormance;)


_________________

------------------------------------------------
Linux Gandalf 3.2.35-grsec
Gentoo Base System version 2.2
------------------------------------------------
Back to top
View user's profile Send private message
The Mountain Man
l33t
l33t


Joined: 03 Sep 2003
Posts: 643

PostPosted: Mon Jan 05, 2004 3:12 pm    Post subject: Reply with quote

As the saying goes, free RAM is wasted RAM.
_________________
I suck at signatures.
Back to top
View user's profile Send private message
Cossins
Veteran
Veteran


Joined: 21 Mar 2003
Posts: 1136
Location: Copenhagen, Denmark

PostPosted: Mon Jan 05, 2004 3:49 pm    Post subject: Reply with quote

mani-man wrote:
Ah, ok.

This is how my meminfo looks like:

Code:

MemTotal:       515304 kB
MemFree:          5888 kB
Buffers:         13580 kB
Cached:         201148 kB
SwapCached:      18700 kB
Active:         308456 kB
Inactive:       138516 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       515304 kB
LowFree:          5888 kB
SwapTotal:      497972 kB
SwapFree:       477320 kB
Dirty:              36 kB
Writeback:           0 kB
Mapped:         291072 kB
Slab:            49132 kB
Committed_AS:   373200 kB
PageTables:       1340 kB
VmallocTotal:   516076 kB
VmallocUsed:    137748 kB
VmallocChunk:   378192 kB


free:
Code:

             total       used       free     shared    buffers     cached
Mem:        515304     503208      12096          0      14284     193760
-/+ buffers/cache:     295164     220140
Swap:       497972      20632     477340



This occurs when I've been using my box for a couple of hours.

Yes, and in reality you have 220 Mb free. When measuring memory usage, it's not the first line of free output that is interesting - it's the second.
The caches and buffers will be deleted as soon as there is need for more memory for other stuff.

If your computer starts swapping spontaneously, it sounds more like a memory leak to me. For instance, Kopete from KDE CVS had a quite serious memory leak a while ago. Within an hour or so, it would use 50% of my memory (according to top), which is 50% of 768 Mb...

- Simon
_________________
who cares
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum