# Memory usage (question)



## etereo (May 18, 2009)

Why does freebsd use only 38mb of ram, which i think is awesome and linux uses about 300-700 mb of ram. Is there something freebsd did differently than linux. why doesnt linux use 38mb of ram? Personally i think the less ram my operating system is using the better for me and also less cpu power.


----------



## DutchDaemon (May 18, 2009)

Please don't use 'question' as a topic title. Use something describing the actual question.


----------



## hedwards (May 19, 2009)

etereo said:
			
		

> Why does freebsd use only 38mb of ram, which i think is awesome and linux uses about 300-700 mb of ram. Is there something freebsd did differently than linux. why doesnt linux use 38mb of ram? Personally i think the less ram my operating system is using the better for me and also less cpu power.


Well, probably the biggest factor is that FreeBSD has historically been more aggressive in its use of swap, whereas Linux would wait longer before using it.


----------



## ale (May 19, 2009)

hedwards said:
			
		

> Well, probably the biggest factor is that FreeBSD has historically been more aggressive in its use of swap, whereas Linux would wait longer before using it.




```
$ swapinfo 
Device          1K-blocks     Used    Avail Capacity
/dev/ad6s1b       4194304        0  4194304     0%
```


----------



## cpeterson (May 19, 2009)

A default freeBSD install is a lot thinner than any default linux install I've seen to date. About the only thing freeBSD starts up besides the kernel by default is syslog and cron, while linux tends to have things like NFS tools enabled by default among numerous other services.

Try a ps -auxww on freeBSD and look at how incredibly few processes are running, try something similar on a fresh RHEL install and it will be at the very least 5 times as many.

Beyond that, I think the freeBSD kernel is slimmer than the linux kernel by a decent amount in terms of memory usage, but compared to the running services this is a rather small factor.


----------



## phoenix (May 20, 2009)

hedwards said:
			
		

> Well, probably the biggest factor is that FreeBSD has historically been more aggressive in its use of swap, whereas Linux would wait longer before using it.



It's actually the other way around, which is why there's a /proc file in Linux to control the swapiness, and there isn't one in FreeBSD.

If you leave a Linux system inactive long enough, it will swap out pretty much everything except the kernel, even if there's nothing running and requesting memory.


----------



## etereo (May 20, 2009)

thanks for the reply's


----------

