# Switching to RAM compilation and some hardware issues?

## pmam

I just replaced my RAM memory from 2G to 4X4G, and want to use it for the compilation process (system updating etc).

Looks it is working ok but before start using it I want to verify if it is properly installed and suitable to my machine. Here output of free:

```
free

              total        used        free      shared  buff/cache   available

Mem:        8171628     1596692     5533988      135528     1040948     6375424

Swap:       2097148           0     2097148
```

And here my mother board spec:

```
SPECIFICATIONS

Processor

■ Intel® CoreTM2 Quad/ CoreTM2 Duo/ Pentium® Dual-Core/ Celeron® processor

in LGA775 package

■ Support 4-pin CPU fan pinheader with fan speed control

(For the latest information about CPU, please visit

http://www.msi.com/index.php?func=cpuform2)

Supported FSB

■ Up to 1333 MHz

Chipset

■ North Bridge: Intel® G41 chipset

■ South Bridge: Intel® ICH7 chipset

Memory

■ 2 DDR2 667/800/1066(OC) DIMM slots (8GB Max)

■ 2 DDR3 800/1066/1333(OC) DIMM slots (8GB Max)

(For more information on compatible components, please visit

http://www.msi.com/index.php?func=testreport)
```

According to these outputs, please advise if it is properly working or need to change something in kernel config etc? 

Memory type is: PC3-8500 DDR3-1066 MHZ – Can verify if it is really working on 1066MHZ?

As you can see, mother board supports FSB up to 1333MHZ – Need to change any kernel config or bios parameter, in order to get maximum performance? 

Regarding RAM compilation: I want to use it in order to save hard disk life and reduce compilation time.

I see that need to follow this wiki: https://wiki.gentoo.org/wiki/Portage_TMPDIR_on_tmpfs

So for my setup need to add following line to /etc/fstab: 

```
tmpfs      /var/tmp/portage      tmpfs   size=8G,uid=portage,gid=portage,mode=775,noatime   0 0
```

That's all or need change kernel config?

----------

## erikm

I don't know your motherboard, so I can't help you there. I can however confirm that the line in /etc/fstab is all you need for compiling in RAM.

----------

## pmam

erikm Hi,

I have put in my previous post the relevant part of my motherboard spec - if it is not enough here the link:

https://us.msi.com/Motherboard/support/G41M-P33-Combo.html#down-manual

Thanks for confirmation regarding fstab!

----------

## krinn

8171628... try free -h to get the picture

because for me 4x4G should gave u twice that number.

it's not because a m/b have 4 banks that you can fill up all the banks with any size memory. Some will allow all 4 filled with 4G, some only with 4x2G...

and some will refuse or work bad with 4x4G from serie X and will nicely work with 4x4G from Z (even when Z and X are in fact from the same manufacturer).

you should had check memory compatibilities before buying, specially for high speed memory usage as most m/b makers are always offering a higher speed than usual. If a chip is given to do 1200mhz, they will offer 1300... if it could do 2000 they will offer some 2133mhz...

but that's not safe or usual speed for that chip, and they do that with tweaks, and in fact the highest speed they offer that is beyond what your chip "should" handle is then tricky as hell to make it work.

From your manual: 

2 DD R2 667/800/1066(OC) DIMM slots (8GB Max)

2 DD R3 800/1066/1333 (OC) DIMM slots (8GB Max)

It explains first your 8G limit, but it also show that 1066 and 1333 are set OC (certainly meaning Overclock), as such it mean "tricky to work at that speed".

Also because of the 2xDDR2 and 2xDDR3 reference and the "combo" type of m/b you have, pretty sure the combo doesn't mean you can use 4 banks at the same time, but only 2xDDR2 or 2xDDR3.

Which raise another question, how did you get 2xDDR2 and 2xDDR3 and didn't ask yourself something wrong is going on. I suppose you have in fact brough 2x4G ram?

That's all i could say from that manual, i'm afraid i was going to much with the babes instead of my Chinese lessons.

Your FSB is set by your cpu: cpu_multiplier_ factor * fsb = cpu speed, so m/b handle the FSB you need base on your cpu. You can however overclock fsb to push your cpu overclock. a 20 * 100 = 2000mhz, while the same cpu at 133 fsb would gave you a 2660mhz cpu.

----------

## pmam

krinn,

Sorry, my fault...   :Sad:   I meant 2X4G (not 4X4G)...

Here:

```
 free -h

              total        used        free      shared  buff/cache   available

Mem:           7.8G        1.4G        194M        177M        6.2G        6.1G

Swap:          2.0G        108K        2.0G
```

I need to read carefully your important info, but meanwhile please refer again to my question with '2X4G' point of view...

As far as I see OC refers to DDR3 1333 only but 1066 should be ok

Sorry again and Thanks

----------

## krinn

if you really care about the clock speed, try lshw (in portage) it certainly can tell you.

```
     *-memory

...

        *-bank:0

             description: DIMM DDR3 Synchronous 1600 MHz (0,6 ns)

             product: F3-2400C11-8GAB

...

             clock: 1600MHz (0.6ns)

```

----------

## NeddySeagoon

pmam,

DRAM sticks, all flavours, contain a small chip called the SPD ROM.

This is read by the system to discover all sorts of useful information about the RAM. Including the default timings.

Some RAM sold as tested overclocked my have the overclocked timings progarmmed into the SPD.

This SPD being used for system set up leads to a whole class of hardware problems when RAM is not a single matched set.

-- edit --

The kernel will keep everything in RAM buffers during compiling, so if you have the RAM to build in RAM if will happen anyway and you see the speed improvement

Mounting /var/tmp/partage as tmpfs does not provide a further speed improvement but it does prevent disk writes that are never read.

```
/dev/shm on /var/tmp/portage type tmpfs (rw,nosuid,nodev,noatime)
```

Your tmpfs will 4G by default, so there are one or two packages that won't build that way.

----------

## Section_8

I recently upgraded from 8G to 16G.  When I had a smallish /var/tmp/portage in tmpfs, I used the technique here:  https://wiki.gentoo.org/wiki//etc/portage/package.env to configure packages needing a bigger /var/tmp/portage than my tmpfs (libreoffice) to automagically revert to a directory on disk.

----------

## pmam

krinn,

Nice to know about lshw - according output, RAM is working on 1066 MHZ and looks ok:

```
*-memory

          description: System Memory

          physical id: 2b

          slot: System board or motherboard

          size: 8GiB

        *-bank:0

             description: DIMM SDRAM Synchronous 1066 MHz (0.9 ns)

             product: ModulePartNumber00

             vendor: Manufacturer00

             physical id: 0

             serial: SerNum00

             slot: DIMM1

             size: 4GiB

             width: 64 bits

             clock: 1066MHz (0.9ns)

        *-bank:1

             description: DIMM SDRAM Synchronous 1066 MHz (0.9 ns)

             product: ModulePartNumber01

             vendor: Manufacturer01

             physical id: 1

             serial: SerNum01

             slot: DIMM2

             size: 4GiB

             width: 64 bits

             clock: 1066MHz (0.9ns)
```

Regarding FSB: I see what you wrote but, how to test the actual FSB? I am not going to change it or over-clocking,

but want to know how to verify and if it is being changed by software or Bios or jumpers on motherboard? 

NeddySeagoon,

Not sure I am well understanding... Do need to add your following line in addition to Mounting /var/tmp/partage as tmpfs?

```
/dev/shm on /var/tmp/portage type tmpfs (rw,nosuid,nodev,noatime)
```

 *Quote:*   

> Your tmpfs will 4G by default, so there are one or two packages that won't build that way.

 

And please explain why only 4G, while I put size=8G in Mounting /var/tmp/partage as tmpfs?

If it is only 4G, need to use  Section_8 link...

Thanks

----------

## krinn

 *pmam wrote:*   

> Regarding FSB: I see what you wrote but, how to test the actual FSB? I am not going to change it or over-clocking,
> 
> but want to know how to verify and if it is being changed by software or Bios or jumpers on motherboard? 
> 
> 

 

It's as easy as that:

```
head /proc/cpuinfo 

processor   : 0

model name   : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz

cpu MHz      : 4007.231

```

if fsb is well set you should have a 4ghz cpu running at 4ghz, if fsb is set higher, cpu will run overclock, and lower underclock.

and seeing a 4ghz cpu running at 4000mhz is just telling you fsb is well set.

----------

## NeddySeagoon

krinn,

That tells the core clock at the time the command is run.

With the assorted speed up/down technologies its easy to get different but equally correct CPU core speeds depending on the system load.

 pmam,

You need a line in /etc/fstab to mount /var/tmp/portage, or whatever your build locations is, as tmpfs, or it won't be automatic.

Do not set size any more that about 6G without only 8G RAM.

tmpfs will swap to your swap partition when there is pressure on RAM. That's slower than normal HDD access as it uses the page size, which is normally 4k.

--edit --

4G is the default half of RAM.

----------

## pmam

Here my frequency - A little bit   :Smile:   slower than krinn's machine, but looks fsb is well set. According MB spec above, FSB supported up to 1333 MHZ...  

```
 head /proc/cpuinfo

processor   : 0

vendor_id   : GenuineIntel

cpu family   : 6

model      : 15

model name   : Intel(R) Core(TM)2 CPU          6300  @ 1.86GHz

stepping   : 6

microcode   : 0xd0

cpu MHz      : 1870.000

cache size   : 2048 KB

physical id   : 0
```

I guess that for 'Portage TMPDIR on tmpfs' can mount /dev/shm as well, but I followed wiki with mounting tmpfs (have changed size to 6G):

```
tmpfs      /var/tmp/portage      tmpfs   size=6G,uid=portage,gid=portage,mode=775,noatime   0 0
```

When had installed Steam according https://wiki.gentoo.org/wiki/Steam, I added this line to fstab - hope there is no conflict...

```
shm        /dev/shm        tmpfs        nodev,nosuid,noexec  0 0
```

 *Quote:*   

> 4G is the default half of RAM.

 

Maybe need to use Section_8's link:  https://wiki.gentoo.org/wiki//etc/portage/package.env  for big packages...

Thanks

----------

