Why does it seem that ubuntu manages memory better


Recommended Posts

So I have been honestly using ubuntu 8 for the better part of the weekend and I honestly like it. I have it split into a couple of workspaces just for kicks to keep everything separate.

With compiz running in all its glory, multiple programs running in each workspace (including ff3 having 10 tabs open), customs themes, etc...

And according to system monitor my memory usage is around 500 mb. So why is it that ubuntu can do all of this with only 500 mb and yet vista needs almost 1.5 gb of memory to run?

It's not that I am complaining or bashing or anything like that. I am a true windows fan and I like vista. I just don't understand this.

Link to comment
Share on other sites

Believe it or not, using more memory is a good thing (to an extent of course). Having free memory lying around is a waste.

But using inefficiently is just as bad as in leaking it as Windows does.

Link to comment
Share on other sites

But using inefficiently is just as bad as in leaking it as Windows does.

inefficient memory usage would be shuffling everything into the page file and back out.

The most efficient use of memory is to store everything in it.

Link to comment
Share on other sites

inefficient memory usage would be shuffling everything into the page file and back out.

The most efficient use of memory is to store everything in it.

And not by way of using it up through leaks....

Link to comment
Share on other sites

In amongst the anecdotal evidence of "personal experiences", and the biased viewpoints from both camps, I think that you can look at how things are structured differently between the two platforms.

But, before I give my point of view, let me just say that memory management is more complex of a subject than what this thread seems to be about: overall "feel" of resource usage (not just memory, but perceived performance by the user). And, for this, we might need to be more specific in our statements.

In my experience, Ubuntu 8.04 is more sluggish than XP on the mid end computers I have used it on at home. However, Vista seems more sluggish on same level PCs (the PC I have Vista experience on is my son's with 512MB RAM with Home Basic). Purely anecdotal and subjective. But it is my personal opinion based on the specific hardware I have used these on.

But "Ubuntu" isn't the only horse in the Linux race, and distros like Arch claim to be better optimized (a claim that I cannot validate or deny, since I have no experience with it). The user-customizable configurability that allows different distros to spring to life is because Linux is generally set up as a very modular and scalable OS. Replace Gnome with XFCE. Or with IceWM. Or Openbox. Select only the apps and packages you want. It is designed to work that way.

And this gives "Linux" (whatever flavor you please) the ability to scale down to work well on low end equipment (EeePC, XO, Zaurus). And if you can scale down to lower hardware easily, it isn't hard to imagine making it run well on other mid/high end hardware.

Is Linux magically "better" than Windows at running? By all means, the answer is no! CPU instructions are CPU instructions. And any small differences in task scheduling optimizations aren't really measurable by an end user, I don't believe. I personally believe that the power in Linux is getting it the way you want, with just what you want.

And, by coincidence, I found this blog entry on O'Reilly.net that is on a similar topic, and is likewise analytical and skeptical of any claims that "X is better than Y", especially when focusing on an experiment with very limited testing.

Link to comment
Share on other sites

And not by way of using it up through leaks....

Well we're never going to fully get rid of leaks.

and Firefox doesn't have that many (half the "memory leaks" aren't memory leaks, they just get called that by people who seemingly don't know what memory leaks are)

Link to comment
Share on other sites

Believe it or not, using more memory is a good thing (to an extent of course). Having free memory lying around is a waste.

Yup. I look at linux and I regularly see 99% RAM usage, and I have 4GiB of RAM. It doesn't bother me. I'm happy that my RAM, that I paid good money for, is going to good use.

Link to comment
Share on other sites

inefficient memory usage would be shuffling everything into the page file and back out.

The most efficient use of memory is to store everything in it.

I must say, my fedora installation never creeps over 300mb of use, even while running a web browser, a music player, talking on pidgin, and having bluefish open. This includes full compiz visualization effects turned on, four virtual desktops. And my page file only has 4 kb used. So it's definitely not swapping data into the page file.

post-180206-1210871563.png

Link to comment
Share on other sites

Yup. I look at linux and I regularly see 99% RAM usage, and I have 4GiB of RAM. It doesn't bother me. I'm happy that my RAM, that I paid good money for, is going to good use.
99% USAGE? :blink:
Link to comment
Share on other sites

99% USAGE? :blink:

I agree. Sounds incredibly high.

I am running 4 different boinc projects, seeding 12 CDs/DVDs on torrent, plus the normal apps open (including Firefox), and am only at 22% RAM usage (4GB installed).

post-36818-1210887435.png

Link to comment
Share on other sites

99% USAGE? :blink:

Yup, doesn't bother me. It would be nice if it wen to 100, but I guess Linux keeps a small buffer zone just in case. Only on my desktop where I'm regularly moving around large files. My laptop stands at 1.8GB out of 4GiB, but it's working set is much smaller than my desktop which is also on for longer than my laptop (I constantly reboot between OSX and Ubuntu).

EDIT: Here we go, 99% usage:

top - 17:55:56 up  4:48,  5 users,  load average: 0.97, 1.28, 0.62
Tasks: 129 total,   1 running, 128 sleeping,   0 stopped,   0 zombie
Cpu(s):  9.8%us,  1.5%sy,  0.0%ni, 88.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   4033840k total,  3997412k used,	36428k free,	29624k buffers
Swap:		0k total,		0k used,		0k free,  3076124k cached

  PID USER	  PR  NI  VIRT  RES  SHR S %CPU %MEM	TIME+  COMMAND			
 6172 amistry   20   0  692m 195m  25m S   14  5.0   6:46.71 firefox			
 9093 root	  20   0  329m  65m  30m S	0  1.7   0:06.32 wireshark		  
 6184 amistry   20   0  329m  65m  13m S	0  1.7   0:01.93 evince			 
 5701 root	  20   0  906m  60m  13m S	3  1.5   7:49.43 Xorg			   
 6165 amistry   20   0  438m  41m  21m S	0  1.1   0:03.38 nautilus		   
 6141 amistry   20   0  268m  28m 9680 S	0  0.7   0:02.67 gnome-settings-	
 6166 amistry   20   0  355m  28m  16m S	0  0.7   0:13.07 gnome-panel		
 6179 amistry   20   0  279m  26m  12m S	0  0.7   0:10.42 gnome-terminal	 
 6173 amistry   20   0  234m  19m  11m S	0  0.5   0:00.74 gvim			   
 6183 amistry   20   0  234m  19m  11m S	0  0.5   0:00.72 gvim			   
 6190 amistry   20   0  204m  18m 9948 S	0  0.5   0:00.20 fusion-icon		
 6392 amistry   20   0  257m  17m  11m S	0  0.5   0:00.24 mixer_applet2	  
 6327 amistry   20   0  234m  16m 9.9m S	2  0.4   0:38.78 sensors-applet	 
 6202 amistry   20   0  189m  16m 8036 S	0  0.4   0:00.54 python			 
 6170 amistry   20   0  228m  15m  10m S	0  0.4   0:00.66 update-notifier

I never said anything about RAM in use by programs.

Edited by MrA
Link to comment
Share on other sites

tl;snipped

You really make me want to install a Linux distro now, you do this a lot. But I know it'd be a complete waste of time because I game far too much, and don't like change at all. There isn't an issue of compatability-I've got a LiveCD (It's there incase my PC died and I just need to boot into something) and it runs very well.

But I've never understood what a memory leak is, and why they occur. Could someone explain?

Link to comment
Share on other sites

But I've never understood what a memory leak is, and why they occur. Could someone explain?

A memory leak is when you allocate memory in a program, but the program doesn't free it. The memory can only be reclaimed by killing the program, in which case the OS will release the memory.

Link to comment
Share on other sites

...

EDIT: Here we go, 99% usage:

top - 17:55:56 up  4:48,  5 users,  load average: 0.97, 1.28, 0.62
<snip>

I never said anything about RAM in use by programs.

The RAM usage I posted at 22% wasn't just "programs", either. But I did a quick "top" here as well, and think I can see part of the difference:
top - 17:29:12 up 43 min,  2 users,  load average: 0.43, 1.07, 1.32
Tasks: 116 total,   1 running, 115 sleeping,   0 stopped,   0 zombie
Cpu(s):  5.4%us,  2.6%sy, 57.3%ni, 34.5%id,  0.2%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3631848k total,   892152k used,  2739696k free,	26756k buffers
Swap:   554232k total,		0k used,   554232k free,   532368k cached

  PID USER	  PR  NI  VIRT  RES  SHR S %CPU %MEM	TIME+  COMMAND			
24357 boinc	 39  19 63408  59m 1420 S   63  1.7   1:34.80 einstein_S5R3_4	 
 6372 boinc	 39  19  277m  74m 1028 S   50  2.1  22:56.36 wcg_dddt_autodo	 
 5895 root	  20   0  320m  31m 6260 S	6  0.9   2:01.59 Xorg				
 6701 mark	  20   0 48564  20m 8224 S	3  0.6   1:24.16 transmission		
 6731 mark	  20   0  185m  61m  20m S	2  1.7   1:24.95 firefox			 
 1491 root	  15  -5	 0	0	0 S	1  0.0   0:00.52 ata/0			   
	1 root	  20   0  2844 1688  544 S	0  0.0   0:01.08 init				
	2 root	  15  -5	 0	0	0 S	0  0.0   0:00.00 kthreadd			
	3 root	  RT  -5	 0	0	0 S	0  0.0   0:00.02 migration/0		 
	4 root	  15  -5	 0	0	0 S	0  0.0   0:00.12 ksoftirqd/0		 
	5 root	  RT  -5	 0	0	0 S	0  0.0   0:00.00 watchdog/0		  
	6 root	  RT  -5	 0	0	0 S	0  0.0   0:00.02 migration/1		 
	7 root	  15  -5	 0	0	0 S	0  0.0   0:00.12 ksoftirqd/1		 
	8 root	  RT  -5	 0	0	0 S	0  0.0   0:00.00 watchdog/1		  
	9 root	  15  -5	 0	0	0 S	0  0.0   0:00.12 events/0

Looks like you are running full Gnome, while I have fluxbox. Still, 99% seems sky-high.

You really make me want to install a Linux distro now, you do this a lot.

...

Sorry. :p Completely unintentional.
Link to comment
Share on other sites

You haven't got a swap file?

Nope. Why bother? I have 4GiB of RAM and I've never gonna use it all up with programs. Even if I accidentally have a memory leak in a program I write, it'll won't spill.

The RAM usage I posted at 22% wasn't just "programs", either. But I did a quick "top" here as well, and think I can see part of the difference:
top - 17:29:12 up 43 min,  2 users,  load average: 0.43, 1.07, 1.32
Tasks: 116 total,   1 running, 115 sleeping,   0 stopped,   0 zombie
Cpu(s):  5.4%us,  2.6%sy, 57.3%ni, 34.5%id,  0.2%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3631848k total,   892152k used,  2739696k free,	26756k buffers
Swap:   554232k total,		0k used,   554232k free,   532368k cached
snip

Looks like you are running full Gnome, while I have fluxbox. Still, 99% seems sky-high.

While mine looks sky-high to you, yours look unusually low to me. I guess it's a matter of perspective.

Link to comment
Share on other sites

Oh, so you're saying you have 4GB of RAM and that Ubuntu can address all 4GB of RAM. I think we understood it as Ubuntu is depleting all your memory, as in programs & OS are occupying all 4GB of RAM. That would be nuts.

Link to comment
Share on other sites

inefficient memory usage would be shuffling everything into the page file and back out.

The most efficient use of memory is to store everything in it.

that isn't efficient, that's stupid. a program should only use the amount of ram it needs to

I agree. Sounds incredibly high.

I am running 4 different boinc projects, seeding 12 CDs/DVDs on torrent, plus the normal apps open (including Firefox), and am only at 22% RAM usage (4GB installed).

post-36818-1210887435.png

i'd say most of his ram of usage is actually the cache, my server runs at 99% "used" ram of which 50-60% is just the cache but gets lumped in with the used amount (though some apps/stats things will remove the cached amount from actual usage)

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.