You are not logged in.

#1 2011-11-19 15:08:50

ford prefect
Member
Registered: 2010-07-08
Posts: 43

[solved?]Why is Arch NOT using all my RAM?

Hi all,
according to the FAQ (https://wiki.archlinux.org/index.php/FA … _my_RAM.3F), also some of my previous experiences with linux, the kernel makes excessive use of the RAM. thats not only fine but thats what i want.
now i use an up-to-date Arch x86_64 / kde with 4GB of RAM, of which only 1,4GB are used, even if i run various torrents and stuff.
now its everything working and fine and all, but i think maybe it should be used (nearly) all, shouldn't it?
so, any hints for /proc-features i missed are appreciated.
so long…
ford

Last edited by ford prefect (2011-11-29 14:44:35)


towel-day.com
nvidia ist keine Hautcreme

Offline

#2 2011-11-19 15:23:56

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved?]Why is Arch NOT using all my RAM?

Can you post the output of 'free -m'?
Try running a virtual machine or two and see if things change.

Offline

#3 2011-11-19 15:28:52

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,732
Website

Re: [solved?]Why is Arch NOT using all my RAM?

I have 8 G here and even when x264 encoding and kernel compiling for example, rarely push over 2 G... are you used to Windows smile

Download linpack from the AUR and set it to use 3.8 G of RAM if you want to make sure it's addressable.

Last edited by graysky (2011-11-19 15:30:12)

Offline

#4 2011-11-19 18:19:06

ford prefect
Member
Registered: 2010-07-08
Posts: 43

Re: [solved?]Why is Arch NOT using all my RAM?

ok, output of free -m

             total       used       free     shared    buffers     cached
Mem:          3949       1579       2370          0         57        564
-/+ buffers/cache:        957       2992
Swap:            0          0          0

(i disabled swap because i needed harddrive…)

the ram is adressable for sure. there are different indicators. first it is shown above, then i wrote a small c-program (learning c atm) allocating space - for fun i pushed it up to the full ram, and also in systemmonitor it shows the complete 3.9GB.

i'll play a little with linpack later today, maybe some VMs too…

but that does not really answer my question yet, right?

…and thanks for all the fish
ford

EDIT: no, not used to windows. i'm clean of that cancer for 4 years now… just some games anymore, nothing serious!

Last edited by ford prefect (2011-11-19 18:20:22)


towel-day.com
nvidia ist keine Hautcreme

Offline

#5 2011-11-19 18:20:58

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved?]Why is Arch NOT using all my RAM?

Is your system slow? Maybe the apps you're using don't need all that much RAM?

Offline

#6 2011-11-19 20:19:31

Grinch
Member
Registered: 2010-11-07
Posts: 265

Re: [solved?]Why is Arch NOT using all my RAM?

Yes that's the obvious conclusion, the system won't just mark ram as used, it actually HAS to be USED by something. Making use of 'excessive' ram generally means that the system caches (mirrors) data which exists on disk. Say you launch application X and exits it, the application remains in the cache memory since that memory isn't needed by any running apps. You launch the application again and instead of launching it from disk it will be launched directly from cache memory which is alot faster. However, cached memory is not the same as 'used' memory since cached memory can instantly be reclaimed by the system should it or any applications need that memory. Your system will automatically cache (keep in ram) applications/libs if there's memory to spare, I believe you can finetune it though if you'd want it to be more aggressive.

Now if you want your system to actually 'use' as much ram as possible in terms of applications then you can likely tune alot of apps to be more memory hungry. You mentioned torrents, by increasing the buffer size in your torrent program to hold as much data as possible before writing it to disk thus making use of your available ram while limiting disk writes. I know this is often employed by torrent seeders in order to minimize disk usage.

Offline

#7 2011-11-19 21:34:26

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,732
Website

Re: [solved?]Why is Arch NOT using all my RAM?

Grinch wrote:

the system won't just mark ram as used, it actually HAS to be USED by something.

graysky wrote:

Download linpack from the AUR and set it to use 3.8 G of RAM if you want to make sure it's addressable.

Offline

#8 2011-11-20 02:07:10

Rodrigo Lipparelli
Member
From: Brazil
Registered: 2011-11-17
Posts: 4

Re: [solved?]Why is Arch NOT using all my RAM?

When I used KDE (with Slackware, before Arch), I had the same picture: RAM memory was used until ~2GB of RAM, and when there was heavy processing or program usage, the swap memory become useful. I guess this is the normal behavior, since swap memory comes to free the cached memory when not used for a long time in benefit of another process/program which needs that memory. Nonetheless, there's a parameter called "vm.swappiness", which can get what you want. The "vm.swappiness" has a value from 0 to 100, 0 meaning that kernel will keep all memory to RAM, and 100 the kernel will keep all memory to DISK. The default value is 60, which is fine by most users. Should you wish to change it, in your terminal window, as root, just try

# sysctl -w vm.swappiness="n"

with double-quotes, where 'n' is a value from 0 to 100. Or,

echo n > /proc/sys/vm/swappiness

will have the same effect as sysctl -w. "$ man sysctl" can give you more info about what can you do with your kernel modules parameters.

Now, I really don't what happens if you set extreme values, like 0 or 100, so I'll not take responsability for any damage. ;-)

Offline

#9 2011-11-20 02:35:05

defears
Member
Registered: 2010-07-26
Posts: 218

Re: [solved?]Why is Arch NOT using all my RAM?

Easy with KDE.
Enable nepomuk indexing to use 1 gig of memory. (I think that was the limit.)

Now the only way for me to go above 1 gig is use a virtual machine or make j64. That's with gnome-shell, openbox, or icewm. I can never stay with one. And I have 8 gig available.

Offline

#10 2011-11-20 20:20:47

ford prefect
Member
Registered: 2010-07-08
Posts: 43

Re: [solved?]Why is Arch NOT using all my RAM?

hm, thanks for all the replys.
i think, its obvious to anyone that there have to be apps using ram. i usually run ktorrent with about 20 seeding torrents. that data is always read from disk, and rarely buffered in ram.  so, as mentioned above, i'll have a lookaround in the configs, to find some ways turning up memory usage.
adjusting swappiness also should make no sense, since i disabled swap completely.
nepomuk was bugging me long time, so i just turned it off…
thanks
ford


towel-day.com
nvidia ist keine Hautcreme

Offline

#11 2011-11-20 23:27:11

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [solved?]Why is Arch NOT using all my RAM?

ford prefect wrote:

i usually run ktorrent with about 20 seeding torrents. that data is always read from disk, and rarely buffered in ram.

I would also think that this should fill your caches. On our main server, we can clearly observe how caches are filled quickly after a reboot, and it's probably because of rsyncd (right now, the machine has 3533MB of cached memory). But even on my laptop, after about 13 hours of uptime, not doing anything extreme, 'free -m' shows 1946MB of cached memory. Your 564MB seem very low.

Offline

#12 2011-11-20 23:34:11

ford prefect
Member
Registered: 2010-07-08
Posts: 43

Re: [solved?]Why is Arch NOT using all my RAM?

see, thats what its all about.
sadly, i dont find any settings in ktorrent. also id like to adjust it on a lower level (kernel) for taking effect for all applications.
any hint how to adjust 'cachiness'?


towel-day.com
nvidia ist keine Hautcreme

Offline

#13 2011-11-23 23:36:06

ford prefect
Member
Registered: 2010-07-08
Posts: 43

Re: [solved?]Why is Arch NOT using all my RAM?

hm, bumbing again. anyone got an idea whats wrong on my machine? sadly i didnt manage to make the internet searching machines spitting out any results related to my problem…


towel-day.com
nvidia ist keine Hautcreme

Offline

#14 2011-11-24 12:41:50

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [solved?]Why is Arch NOT using all my RAM?

What kind of uptime are we talking about?

Offline

#15 2011-11-24 12:46:40

ford prefect
Member
Registered: 2010-07-08
Posts: 43

Re: [solved?]Why is Arch NOT using all my RAM?

its not depending on uptime. after start od all apps it uses about 1.4G and that doesnt change significantly over time.


towel-day.com
nvidia ist keine Hautcreme

Offline

#16 2011-11-25 05:53:38

Larsson
Member
From: Sweden
Registered: 2010-03-22
Posts: 157

Re: [solved?]Why is Arch NOT using all my RAM?

Try starting more apps, open more tabs in firefox etc, see if you can boost the RAM usage. I think only then can we conclude that your RAM usage is capped somehow.


"If the person you are talking to doesn't appear to be listening, be patient. It may simply be that he has a small piece of fluff in his ear." - A.A. Milne (Winnie-the-Pooh)

Offline

#17 2011-11-26 20:12:56

ghost333
Member
Registered: 2011-11-26
Posts: 25

Re: [solved?]Why is Arch NOT using all my RAM?

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>


int main(int argc, char** argv) {
    int max,secs  = -1;
    int mb = 0;
    char* buffer;
    	
    if(argc > 1)
        max = atoi(argv[1]);
    if(argc > 1)
	secs = atoi(argv[2]);	

    while((buffer=malloc(1024*1024)) != NULL && mb != max) {
        memset(buffer, 0, 1024*1024);
        mb++;
	sleep(secs/1000);
        printf("Allocated %d MB\n", mb);
    }
    
    return 0;
}

compile the above if you know how or else just tell me so i can tell you how to do it or read below
(i had it compile  as eatMB if not replace on the example below)
and then run:
./eatMB 8000 0

at what number does the program stop?

(the command is ./eatMB {amount of RAM to Allocate}  {time between each 1MB allocated ,1000= 1 sec}

in case u cant compile just copy-paste and run the following in a terminal:

echo "#include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h>
int main(int argc, char** argv) {int max,secs  = -1;int mb = 0;char* buffer;if(argc > 1) max = atoi(argv[1]);if(argc > 1) secs = atoi(argv[2]);while((buffer=malloc(1024*1024)) != NULL && mb != max) {memset(buffer, 0, 1024*1024);mb++;sleep(secs/1000);printf(\"Allocated %d MB\n\", mb);}return 0;}" > eatMB.c && gcc eatMB.c -o eatMB && ./eatMB 8000 0

don't forget to delete eatMB.c and eatMB files after u are done tongue

Last edited by ghost333 (2011-11-26 20:14:49)

Offline

#18 2011-11-26 23:38:22

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: [solved?]Why is Arch NOT using all my RAM?

open more random files or watch more youtube. !next


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#19 2011-11-28 11:35:39

ford prefect
Member
Registered: 2010-07-08
Posts: 43

Re: [solved?]Why is Arch NOT using all my RAM?

so, whatever happend, here some surprising news:

$ free -m
             total       used       free     shared    buffers     cached
Mem:          3949       3831        117          0         29       2348
-/+ buffers/cache:       1454       2495
Swap:            0          0          0

i did not change anything, anybody can explain? i'd rather dislike to mark this thread as solved bevore there is any explain of that…
thx
ford


towel-day.com
nvidia ist keine Hautcreme

Offline

#20 2011-11-28 14:50:24

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [solved?]Why is Arch NOT using all my RAM?

I still say uptime.

Offline

#21 2011-11-29 14:42:35

ford prefect
Member
Registered: 2010-07-08
Posts: 43

Re: [solved?]Why is Arch NOT using all my RAM?

nope, no uptime related issue at all. now i have an uptime of 14min and ram is all filled. whatever changed, i cannot see any reason.
i'll mark thread as solved, but explains are still welcome!
_

dear reader in the future: sorry. i dont know what happend to change this…
http://xkcd.com/979/


towel-day.com
nvidia ist keine Hautcreme

Offline

Board footer

Powered by FluxBB