# Need more RAM or a 32bits system?



## FIlIPy65 (Jul 6, 2012)

Dear friends,
I'm almost happy with the latest 64bits version of the FreeBSD, almost...

I have a Pentium E5700 with 2GB RAM (2x1GB 667MHz DDR2) (all donation =p) and I note that everything eats a little more of RAM (64bit system?). Right now, XFCE 4.10 with Deadbeef, Terminal and various tabs in Firefox are eating ~80% of all my RAM.
Usually I need to use all this plus Virtualbox with a Windows 7 or GIMP+Inkscape.
This way my system is going to blow (or use swap intensely) right?

I was thinking in go to the 32bits version, but I compile all my programs, and comments says that exists a significantly difference in compiling performance.

So what the friends suggest? Since I think in add the /tmp to tmpfs too.
Buy more RAM? (How much?) Or should I go be happy within 32bits system?
(I'm asking because large capacities of DDR2 RAM are a little expensive for me. [any donation?!] =x)

Cheers.


----------



## SirDice (Jul 6, 2012)

Stick more RAM in it. Certainly if you're going to use virtual machines on it. With 4GB you shouldn't have a problem with a small Windows 7 virtual machine. More is obviously better.

Keep in mind that FreeBSD will use most of the available RAM for caching. Unused RAM is wasted RAM.


----------



## FIlIPy65 (Jul 6, 2012)

I see.
I'm looking for 800MHz 2GB modules, looks hard to find 800MHz 4GB modules (at reasonable price). My board have 4 banks, but there are reports about performance lost filling the 4 banks. So I'm thinking serious in places 2x2GB 800MHz modules (dual channel).

Should I disable swap (to avoid disk access)?
Should I place /tmp or some olthers to tmpfs?
It's related port and src's working dir to tmpfs. o.o

Cheers.


----------



## wblock@ (Jul 6, 2012)

FIlIPy65 said:
			
		

> Should I disable swap (to avoid disk access)?



No, swap is particularly useful when memory is low.  But you don't say how much drive space is available.



> Should I place /tmp or some olthers to tmpfs?



No, that uses more RAM.  Maybe not enough to matter, though.

There are a few socket 775 motherboards that take DDR3 memory.  One of those plus new DDR3 memory might be cheaper than just DDR2 memory to go in the existing motherboard.  Might also have a higher total memory limit than the older motherboard.


----------



## FIlIPy65 (Jul 7, 2012)

Yeah, DDR3 would be great! But my processor FSB is 800MHz and is very hard to find DDR3 800Mhz nowadays and maybe downclock a DDR3 to keep the synchronize with the processor wouldn't be the best thing to do.
Another thing, is that I have a nice Asus P5K-VM motherboard, so taking a board at "this level" plus DDR3 modules could not be better than just buying DDR2 modules. A nice thing is that I could use these DDR3 modules in a future upgrade, but a hardware like mine (soon I buy a nvidia card) running a FreeBSD system I think will be useful for long time. Don't you think? 



			
				wblock@ said:
			
		

> Might also have a higher total memory limit than the older motherboard.


As I searched, 8GB is the limit, it's the same of mine.

Cheers.


----------



## FIlIPy65 (Jul 7, 2012)

About disk, right now I have a simple 160GB SATA drive:

```
=>       34  312581741  ada0  GPT  (149G)
         34    1048576        - free -  (512M)
    1048610        128     2  freebsd-boot  (64k)
    1048738    1048576     1  freebsd-swap  (512M)
    2097314   31457280     3  freebsd-ufs  (15G)
   33554594  278921216     4  freebsd-ufs  (133G)
  312475810     105965        - free -  (51M)
```
I hope repartition my entire disk this weekend.
I miss some set, and lost 512MB in the begin of the disk. =/
I set 15GB to the root (ridiculous), in the LibreOffice build the free space gone to -1GB. (Negative value, is that possible? o.o)

I came from Linux, and my culture is to have /boot, /home and / partitions yet. But I've noted here the better (at least) is have /, /usr/local, /tmp, /var and maybe /home.



			
				wblock@ said:
			
		

> No, that uses more RAM.  Maybe not enough to matter, though.


tmpfs uses all available RAM and then swap? If yes, maybe I set 8GB or more to swap and then set WRKDIRPREFIX to /tmp. What do you think? A good plan?

I'm thinking in (at least): / (4GB), /usr (16GB), /usr/home (remain), /var (1GB), swap (8GB)

Is this ok? Since I will use MBR partitioning there's no need to boot partition (ok?).
I must active Soft Updates and Journaling in all partitions?

Cheers.


----------



## wblock@ (Jul 7, 2012)

FIlIPy65 said:
			
		

> About disk, right now I have a simple 160GB SATA drive:
> 
> I hope repartition my entire disk this weekend.
> I miss some set, and lost 512MB in the begin of the disk. =/
> ...



Yes.  FreeBSD is not Linux, and trying to treat it the same is often a mistake.



> tmpfs uses all available RAM and then swap?



Well, if it is filled enough.  A maximum size can be set.  But why use RAM for that when RAM is limited?  Create a small /tmp partition and use that.



> I'm thinking in (at least): / (4GB), /usr (16GB), /usr/home (remain), /var (1GB), swap (8GB)



2G is generally enough for /.  Splitting /usr and /usr/home is a premature optimization that many people regret.  If you must do that, give more than 16G to /usr.  1G for /var is fine unless you plan to keep additional databases there.  8G for swap is probably way more than necessary.


----------



## FIlIPy65 (Jul 7, 2012)

wblock@ said:
			
		

> But why use RAM for that when RAM is limited?  Create a small /tmp partition and use that.





			
				wblock@ said:
			
		

> 8G for swap is probably way more than necessary.


Attach swap to ("increase") RAM it's the idea, since I plan to set WRKDIRPREFIX to tmpfs. Build LibreOffice, Firefox and others "big" applications takes a lot of space.
Do you think 4GB is enough? Do I am thinking in wrong way?



			
				wblock@ said:
			
		

> 2G is generally enough for /.


Maybe, if you don't run Linux compatibility (using /compat). Anyway, I'll search a way to place /compat in /usr or /usr/local instead using symlink.



			
				wblock@ said:
			
		

> Splitting /usr and /usr/home is a premature optimization that many people regret.


Sorry, I was sleepy, I want to say /usr/local/home. A separately home partition is really essential.



			
				wblock@ said:
			
		

> If you must do that, give more than 16G to /usr.


Should I place /usr/ports and /usr/src (and some similar thing) to /usr/local and set different partitions to /usr (2GB?) and /usr/local (30GB?). I read that /usr is necessary to bring a system up.

I'll do some search about the soft updates and journaling options to adjust partition scheme for best performance. 

Thanks and cheers.


----------



## kpa (Jul 7, 2012)

Using swap to increase memory is a bad idea, once the system starts swapping when physical RAM runs out the performance goes out of the window. Swap is meant to be used as a last resort backing store for inactive processes when physical memory is running low.

Compiling ports or the system sources is CPU intensive and not I/O intensive so the speedup from using a RAM disk as a scratch disk won't be that much.


----------



## wblock@ (Jul 7, 2012)

FIlIPy65 said:
			
		

> Attach swap to ("increase") RAM it's the idea, since I plan to set WRKDIRPREFIX to tmpfs. Build LibreOffice, Firefox and others "big" applications takes a lot of space.
> Do you think 4GB is enough? Do I am thinking in wrong way?



I don't think that will work well.



> Maybe, if you don't run Linux compatibility (using /compat). Anyway, I'll search a way to place /compat in /usr or /usr/local instead using symlink.



All of /compat is only 217M here.  Remember that in FreeBSD, applications go in /usr/local, Linux applications also.  All port distfiles go in /usr/ports.  Those are a couple of reasons why giving too little space to /usr is a problem.


----------



## FIlIPy65 (Jul 7, 2012)

From the FreeBSD Wiki:


> Size swap space to approximately twice the size of main memory on systems with less than 4GB RAM and the size of main memory for systems with more than 4GB. If in doubt, allocate more swap; allocating insufficient swap is far worse than allocating too much.





> However, if you install a lot of ports (especially window managers and Linux-emulated binaries), we recommend at least a 30 GB /usr and if you also intend to keep system source on the machine, we recommend a 40 GB /usr. Do not underestimate the amount of space you will need in this partition, it can creep up and surprise you!


As the friends suggested, I'm going place ~4GB to swap...
And as wblock@ suggested, I'll give more than 16GB to /usr. :s
But I stay confused about splitting /usr/local from /usr...



			
				&quot said:
			
		

> Using swap to increase memory is a bad idea...


Maybe "increase" was not the best word to explain the idea, because this was between *"*.
The idea is when the system goes out of memory, it just starts using swap available. 

I read a little about tmpfs use, and attempting to this thread on lists and this topic on the forum it's ok to use, but keeps the warning about limit of the "drive" size.

I'm testing here, and looks working nice.
Here the swap looks inactive:

```
Mem: 301M Active, 917M Inact, 414M Wired, 7856K Cache, 212M Buf, 319M Free
Swap: 512M Total, 512M Free
```
So I copied some of the files from /usr/ports/distfiles to /tmp, and it looks working:

```
Mem: 1152M Active, 265M Inact, 442M Wired, 79M Cache, 212M Buf, 22M Free
Swap: 512M Total, 104M Used, 407M Free, 20% Inuse
```

There's a note about tmpfs be experimental, and some people suggest the use of tmpmfs instead.

Cheers.


----------



## Deleted member 30996 (Jul 17, 2012)

FIlIPy65 said:
			
		

> I have a Pentium E5700 with 2GB RAM (2x1GB 667MHz DDR2) (all donation =p) and I note that everything eats a little more of RAM (64bit system?). Right now, XFCE 4.10 with Deadbeef, Terminal and various tabs in Firefox are eating ~80% of all my RAM.
> Usually I need to use all this plus Virtualbox with a Windows 7 or GIMP+Inkscape.
> This way my system is going to blow (or use swap intensely) right?
> 
> ...



Why don't you consider using a WM like fluxbox that most likely won't use as much of your resources as XFCE?

I use fluxbox on my laptop running FreeBSD 9.0 RELEASE 32bit. It has a 2GB DDR2 capacity and with 3 terminals, gkrellm, XFE, and one instance of firefox open is only using 25% of the RAM and no swap. I just go with the default partitioning, compile all my programs from ports, and never use as much as you're seeing.

I recently upgraded it from 1GB RAM and have a couple sticks of 512MB DDR2 PC2-5300 RAM you can have if it will help you out.


----------



## FIlIPy65 (Jul 18, 2012)

Trihexagonal said:
			
		

> I recently upgraded it from 1GB RAM and have a couple sticks of 512MB DDR2 PC2-5300 RAM you can have if it will help you out.


Since I'm not with 2GB, I had to share 1GB with other PC without nothing. So, will help for sure. Thanks! =D



			
				Trihexagonal said:
			
		

> Why don't you consider using a WM like fluxbox that most likely won't use as much of your resources as XFCE?


I really like DEs, I would like to try Etoile (couldn't compile) and (again) Enlightenment (not complete at all).

From pure WMs, I would like to try (again) WindowMaker (wich is failing to compile) because it's stylish (XD) and have a config tool. The others needs some time to let more useful, and unfortunately I don't have this time for now.

Cheers.


----------



## Deleted member 30996 (Jul 19, 2012)

FIlIPy65 said:
			
		

> Since I'm not with 2GB, I had to share 1GB *with other PC* without nothing.



Laptop RAM sticks are half the length of those used in a PC and won't fit the memory slot of one. 



			
				FIlIPy65 said:
			
		

> I really like DEs, I would like to try Etoile (couldn't compile) and (again) Enlightenment (not complete at all).
> 
> From pure WMs, I would like to try (again) WindowMaker (wich is failing to compile) because it's stylish (XD) and have a config tool. The others needs some time to let more useful, and unfortunately I don't have this time for now.



I didn't like fluxbox at all when I first started using it and and didn't see what the hype was about, but did so because my laptop only had 1 GB RAM. Now if I use anything else I'm constantly right-clicking on the desktop for the menu. 

It should compile without any problems and you might find you like it if you give it a chance. It will no doubt use less resources and is worth a try on those merits alone. You can always switch back.


----------



## FIlIPy65 (Jul 25, 2012)

Trihexagonal said:
			
		

> Laptop RAM sticks are half the length of those used in a PC and won't fit the memory slot of one.


Oh, you didn't mention that was SO-DIMM...
I didn't want it anyway. 


I'm little busy these days, so I prefer not try nothing for while.
After, I will give a try some *box. =)

Cheers.


----------

