You are not logged in.

#1 2015-05-11 14:00:30

Koven
Member
Registered: 2006-06-13
Posts: 154

Cache memory is working really bad

I don't know how to deal with this but the problem is that when I just power on my laptop, I can see with top command that the memory buffer/cache is eating almost all memory, I've 8GB as you can see in this picture.

http://www.noelshack.com/2015-20-143135 … -49-36.png

When I run this command

sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"

I can see buffer/cache memory goes down about 3GB as you can see here.

http://www.noelshack.com/2015-20-143135 … -49-57.png

So if I dont' free that memory linux begins to swap and the computer goes really slow, I'm not sure if this happened after linux 4 upgrade or linux 3.16 upgrade but some of them really are eating my memory,  I don't know how to monitor this behaviour with cache memory.

Thanks!

BR

Last edited by Koven (2015-05-11 14:02:48)

Offline

#2 2015-05-11 14:22:34

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Cache memory is working really bad

Koven wrote:

I can see with top command that the memory buffer/cache is eating almost all memory

The cache is supposed to use up all your memory: it keeps the disk's content in the RAM to accelerate data access. It is periodically flushed out to the disk, and the kernel should shrink the cache in response to "real" memory need.

The buffer is... I'm not exactly sure, but I guess it's for, well, buffers (network, file I/O, ...) and usually pretty small.

Source: http://stackoverflow.com/questions/6345 … r-vs-cache

The cache/buffer behaviour is thus nothing wrong (and in fact, it's been like this for a loong time, not just since Linux 4).

Koven wrote:

[..] linux begins to swap and the computer goes really slow

Can you confirm that? Like, the output of `free -m` the moment it starts swapping. Because it shouldn't start swapping just like that. And if it does, what's the application causing it?

EDIT

Looking at Lone_wolf's response, if the occupation of your cache is like that right after booting up, it does raise a few questions, though. Are you somehow indexing your files, or launching/reading something really big during startup?

Last edited by ayekat (2015-05-11 14:35:14)


pkgs │ hacks │ cfg │ blag

Offline

#3 2015-05-11 14:26:08

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,557

Re: Cache memory is working really bad

Your available memory was 5318 before the drop cache command, 5,418 after .

swap should not be needed.

I do think 3 Gib for system just after starting is way to much though.

Is this after a cold boot or are you resuming from hibernate ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#4 2015-05-11 14:52:21

Koven
Member
Registered: 2006-06-13
Posts: 154

Re: Cache memory is working really bad

Lone_Wolf wrote:

swap should not be needed.

I do think 3 Gib for system just after starting is way to much though.

Is this after a cold boot or are you resuming from hibernate ?

I powered off my computer since friday, and now I've just to power on and that is the behaviour.

ayekat wrote:

Can you confirm that? Like, the output of `free -m` the moment it starts swapping. Because it shouldn't start swapping just like that. And if it does, what's the application causing it?

Before something happened, I don't know what, my laptop never swapped , right now it swaps, can take even 2GB but I'm not letting this to happen. BTW any software. libreoffice, virtualbox, I've an opendj for test purposes, takes a lot of time to run anything.

Thanks!

Offline

Board footer

Powered by FluxBB