# Too much RAM?

## Bigun

I've got a system that (at one time) had way too little RAM, only 2 GB.

I decided to go overboard and install 16GB of RAM I borrowed from someone.  What I expected is a few gigabytes of RAM to get used, and the rest used for caching.

What wound up happening is a few gigabytes got used, and only about 6 gigabytes got cached, and 8GB unused.

Do I just have too much RAM?  Or is there a kernel/system setting that may need to be adjusted?

----------

## Jaglover

Use the RAM overage for tmpfs and let portage use it. Faster and less stress on your hard drive.

https://wiki.gentoo.org/wiki/Portage_TMPDIR_on_tmpfs

----------

## John R. Graham

Well it certainly doesn't hurt anything just sitting there, not even power consumption by any appreciable amount.

I'd say start a build of chromium with --jobs set in MAKEOPTS appropriately for your number of cores and monitor memory usage. On my main development system with 16 cores and 32GiB if RAM, it idles at about 16GiB free but mid-build of chromium it drops to less than 5GiB free sometimes.

- John

----------

## Bigun

 *John R. Graham wrote:*   

> Well it certainly doesn't hurt anything just sitting there, not even power consumption by any appreciable amount.
> 
> I'd say start a build of chromium with --jobs set in MAKEOPTS appropriately for your number of cores and monitor memory usage. On my main development system with 16 cores and 32GiB if RAM, it idles at about 16GiB free but mid-build of chromium it drops to less than 5GiB free sometimes.
> 
> - John

 

It's a headless server.  It runs MySQL, Apache, PHP, and a 7 Days to Die server.

----------

## frostschutz

 *Bigun wrote:*   

> Do I just have too much RAM?

 

If you're not doing much I/O then... yes.

Caching is mostly files, but if you don't read files a lot, you don't get much in the cache.

If you read a file only once, while it would be in the cache afterwards, it won't serve any purpose if you don't read it again (it'll be the first thing to go once something else wants to be cached though).

So in a way a "full" cache might not be any more useful than "free ram" in some cases. Cache is always a hit and miss.

----------

## szatox

 *Quote:*   

> Do I just have too much RAM?

 Java has too much RAM. Chrome and "modern" firefox too.

Taking it more seriously, it depends on $$ you have to pay for it. Oh, and if you test RAM during BIOS phase every time you boot, every single GB needs extra time.

Otherwise... There is no such thing as "too much" of resources.

----------

## Jaglover

Too much RAM?

```
server ~ # free -h

              total        used        free      shared  buff/cache   available

Mem:            15G        9.1G        3.6G        356K        2.8G        6.2G

Swap:          1.0G        632K        1.0G

server ~ # uptime

 15:26:52 up 67 days, 23:26,  2 users,  load average: 0.02, 0.05, 0.11

```

----------

## 1clue

My smallest gentoo box has 16g ram. The longer your system stays up the more RAM is used as disk cache. It's a logarithmic progression, so the first few days system cache grows pretty fast, then on it creeps up slower and slower.

I use a lot of VMs, not as end-user desktops but as servers. Each needs enough RAM to function. Depending on the desired performance they may need a lot of memory.

Use tmpfs where appropriate

Play with MAKEOPTS="-jSOMETHING" where SOMETHING is an appropriate value for your number of cores. Don't feel constrained by the normal docs.  I've used -j12 or more on an 8-core box, if you don't have anything pressing to do on the box it's fine and gets the building done faster at the expense of interface lag.

If you use VMs then 16g may easily be eaten up and you may need a lot more.

Only you can determine what the best use of your system might be.

A normal user system, no VMs and just web browsing and office-style work probably would be pressed to use more than 2-4g. Gaming I don't know much about but I understand it can require a lot of cores and a lot of RAM. VMs take a chunk, depending on what you do with the VM.

----------

## Akkara

I think the intent of the original question has been overlooked in the replies.  So I'll try responding even though I'm not completely sure of the fine details of what I'm about to say:

You might be running into a hardware limitation of your current motherboard or CPU/northbridge combo.

There's a fixed limit to now many address lines are brought out from the CPU to the RAM modules.  Just because it is a 64-bit CPU doesn't mean all 64 address wires are brought out to the external interface.  It almost always is less than this.  It can vary depending on CPU, northbridge, and sometimes even motherboard and memory sockets.  If as you say this system is old, it is possible there's only enough pins to address 8GB.

It might also be a limit set by bios.  Maybe it only looks for up this much and won't report on more.  Updating the bios could help if that's where the limit is coming from.

----------

## C5ace

 *Bigun wrote:*   

> I've got a system that (at one time) had way too little RAM, only 2 GB.
> 
> I decided to go overboard and install 16GB of RAM I borrowed from someone.  What I expected is a few gigabytes of RAM to get used, and the rest used for caching.
> 
> What wound up happening is a few gigabytes got used, and only about 6 gigabytes got cached, and 8GB unused.
> ...

 

My Desktop with Gigabyte Technology Co., Ltd. GA-MA790FXT-UD5P Main Board and a x86_64 AMD Phenom II X4 945 Processor of 2007 vintage only supports up to 8GB RAM in 4 sockets with up to 2GB each.

----------

## Tony0945

Regarding Akkara's comment, you can use the Crucial Advisor Tool to determine your maximum memory and configuration. 

http://www.crucial.com/  The System scanner only works for Windows, but the Advisor Tool has a huge database of motherboard's. Besides advising you of compatible Crucial memory (obviously, it's intent is to sell you their memory sticks) it will specify things like ECC/non-ECC, number of slots, maximum memory and type (maximum RAM per stick, pins etc.) of memory. It's a good reference. I find it handier than searching for my (often unintelligible) mobo manual.

----------

## NeddySeagoon

The memory limit imposed by hardware is more subtle than Akkara describes.

To address DRAMs, the address from the CPU is split into two, the two parts are then interleaved on the same pins on the DRAM.

This gets the row address and column address.  If you look in your BIOS, you will see things related to RAS and CAS timings. 

They are Row Address and Column Address Strobes. Don't fiddle with the timings. Horrible things will happen.

Conceptually, then DRAMs are a rectangular array of locations, usually not square.

Memory controllers know this and will address a maximum number of rows and a maximum number of columns.

Over the years, bigger DRAMs are manufactured, with larger numbers of rows and or columns (or both.)

Our old DRAM controller cannot address these extra rows and columns, so the memory appears smaller than was expected.

That's not to say you can't fit more RAM, its just a waste using DRAMs with the wrong 'geometry'.

However, some memory sticks have more chips on than others. Provided the DRAM controller can drive the  'geometry' of the chips, decoding which chips to address is performed outside the DRAM silicon. 

Thus some memory sticks (with more smaller geometry DRAMs) work while those with fewer but larger geometry DRAMs don't.

----------

## Fitzcarraldo

dmidecode is also a handy tool. It's in the Portage main tree.

 *dmidecode man page wrote:*   

> The DMI table doesn't only describe what the system is currently made of, it also can report the possible evolutions (such as the fastest supported CPU or the maximal amount of memory supported).

 

----------

## szatox

Neddy, Akkara, would the part of RAM not addressable by the controller still recognised by the system as present?

You know, shouldn't it report only 8GB total if this was the hardware's limit? I think exactly this used to happen if you stuffed 4GB RAM into 32 bit system. It would cap the around 3.5GB due to a part of address space being reserved for MMIO (though there were some patches to circumvent this issue)

----------

## NeddySeagoon

szatox,

That depends if the system reads the Serial Presence Detect ROM on each DRAM stick or uses the amount of RAM detected.

The detected RAM would agree with the hardware limit. The SPD will describe the memory stick.

----------

