You are not logged in.

#1 2010-04-28 14:19:14

skai
Member
Registered: 2009-03-01
Posts: 34

memory usage growing

Hi everyone,

this is *not* a troll, neither a very precise problem. It's more of a feeling, I'd like to know if someone elses noticed someting like that.

Since, let's say a week, my arch  seems to be using more memeory than what it used to.
I'm on a xfce4 desktop, running an applet that shows cpu and mem usage.

The mem gaguge used to stay at one third, sometimes half of the 2 gigs I have.

Now it quickly fills up, never to go down again.

using 'top' shows me that the gauge report is consistent.


What do I do on this box ? web browsing, quod libet listening, burning with xfburn. That's all.

Once again, it's just a feeling, the system isn't slow or whatever, yet I was not used to that behaviour. (or maybe I need sleep, that's another possible explanation... ;-) )

Offline

#2 2010-04-28 14:26:46

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: memory usage growing

Your "feeling" will need to be backed up by hard evidence. My suggestion would be reboot the machine then immediately take a snapshot of the status of RAM and processes, something like:

free > snapshot1 ; ps aux >> snapshot1

Then next time you "feel" your memory usage is growing take another snapshot and compare the two to determine if there is some memory culprit or not.


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#3 2010-04-28 15:27:16

Cyrusm
Member
From: Bozeman, MT
Registered: 2007-11-15
Posts: 1,053

Re: memory usage growing

It's worth taking a look at the bug reports for some of the major programs you keep open to see if there have been any reported memory leaks.
it's a pretty common problem with larger programs (and regretfully usually the hardest bug to troubleshoot) 
The problem could be in any program or daemon that you are running.

it seems like one (or more) of the programs is allocating a large amount of memory without freeing it after it is no longer needed.  if you can track down the program that's causing the problem
your most likely options are
1) be an hero and fix the memory leak.
2) find the program that's causing the problem, and create a bug report, then wait for future releases
3) research alternate programs.


Hofstadter's Law:
           It always takes longer than you expect, even when you take into account Hofstadter's Law.

Offline

#4 2010-04-28 15:54:50

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

Re: memory usage growing

Apart form has been already said, why do you have 2 GB RAM if you (the apps) don't use it? If your apps are lagging - you have a problem, but if they're snappy - why bother too much?
Use htop or 'ps aux' - start w/ 'ps aux | grep <username>' and tackle the things you run as root / daemon later.

I'm also browsing and listening to music but I use dwm instead of xfce and mplayer / moc for the music. The setup never uses more than half a gig of RAM - even after week+ of uptime. How can I be sure it doesn't? That's all there is in the box - 512 MB :-)

Offline

#5 2010-04-28 16:10:47

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,393

Re: memory usage growing

How do you measure the ram used?
use free or htop, because buffers and cache has not to take into account, they are used by the kernel to keep the system snappier (under certain circumstances).


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#6 2010-04-28 16:24:11

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,774

Re: memory usage growing

skai wrote:

Hi everyone,

The mem gaguge used to stay at one third, sometimes half of the 2 gigs I have.
Now it quickly fills up, never to go down again.

Is that not the expected behavior?  To me, it sounds as if your system is properly caching things to memory in attempt to increase system speed by anticipating future reads from disk and caching those data in advance.  if the system suddenly needs the RAM, it just dumps the cache and reallocates the RAM where needed.

I would venture your system has not started to use the swap space as yet.  If you had a bad memory leak, I would expect the growth to expand beyond RAM and into the swap.  That would be a real problem.

Here is the output of free from my system.  Note the large cache usage.

ewaller@odin:~ 1010 %free
             total       used       free     shared    buffers     cached
Mem:       3958036    3901188      56848          0     371824    1514060
-/+ buffers/cache:    2015304    1942732
Swap:      4000144       6280    3993864

Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2010-04-29 19:26:02

skai
Member
Registered: 2009-03-01
Posts: 34

Re: memory usage growing

Ok guys, I made some very light "tests", paying attention to the apps I use and so on.

False Alert : the "hungry" app was XFburn. I can understand that - having to manage a big amount of datas, why not using the available space.
(as says ewaller : that's what shoul be expected)

It's more strange to see that the memory isnt' free after closing this app, but then : it crashes somtimes more than it shoud so ... I'd rather look in that direction.

At the moment I'm running without any other app than quod libet and a browser,
and the system reacts as it should.

             total       used       free     shared    buffers     cached
Mem:       2057580     654164    1403416          0      55568     197044
-/+ buffers/cache:     401552    1656028
Swap:      2000052      48428    1951624



Anyway forget about this post,

and thank you !

Offline

#8 2010-04-29 19:36:48

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: memory usage growing

You can see if it is only file caches by

sync && echo 3 > /proc/sys/vm/drop_caches

as root.

If after that the ram usage is back to normal the high usage doesn't mean anything because that is ram that can be freed very fastly if needed.


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#9 2010-10-31 20:57:48

dakt
Member
From: Croatia
Registered: 2010-10-04
Posts: 67

Re: memory usage growing

I have to report the same thing...but I think these really are caches since when I drop them it falls down to ~250MB which is inital usage right after the boot. Or could it be that page tables for certain processes are kept for future use???
Before that, after 3 days of uptime, usage was above 1GB (reported by free(1)) and exactly 1/2 of that reported by SystemLoadMonitor??? Sure...caches...but that much?

So right now I have:

             total       used       free     shared    buffers     cached
Mem:          2006        237       1769          0          7         88
-/+ buffers/cache:        141       1865
Swap:         4095          0       4095

SystemLoadMonitor reports 149MB.

I will report new resaults in 3 days.

EDIT: yeep...looks like these really are page caches. Anyway:

To free pagecache:

    * echo 1 > /proc/sys/vm/drop_caches

To free dentries and inodes:

    * echo 2 > /proc/sys/vm/drop_caches

To free pagecache, dentries and inodes:

    * echo 3 > /proc/sys/vm/drop_caches

Last edited by dakt (2010-10-31 21:02:59)

Offline

#10 2010-11-01 00:19:58

ChoK
Member
From: France
Registered: 2008-10-01
Posts: 346

Re: memory usage growing

to debug memory usage of a process you can use pmap -d `pidof <name of process>`, it will tell you which libraries are loaded by the process and how much RAM they are using.


Ah, good taste! What a dreadful thing! Taste is the enemy of creativeness.
Picasso
Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away.
Saint Exupéry

Offline

Board footer

Powered by FluxBB