View previous topic :: View next topic |
Author |
Message |
stegerpl Apprentice
Joined: 25 Jun 2005 Posts: 185 Location: 48°19'30"N 14°20'18"E
|
Posted: Sun Oct 11, 2009 11:26 am Post subject: releasing of RAM - gwenview, gimp |
|
|
Hi,
Since I have 4 GB of installed RAM I never thought to run in a problem with RAM so I disabled swap. However two weeks ago I figured out some effects when dealing with large photos (panoramas with 7 images each 2-3 MB). So I activated swap with 5 GB and added a free memory indication to one of my superkaramba themes.
Now I can see that when I work with gwenview (an image-viewer of KDE) as well as GIMP the memory consumption reaches the physical limits and swap is activated (rarely). But when I close the images within the programs, the memory consumption does not reduce. Even when I close the programs the memory consumption goes down to only about 3 GB and does not go back to about 1,5 GB which seems to be the normal consumption in my system.
Any hints where I can tune the release of memory ?
Is there a kernel feature which has to be activated ?
Any further information where I should have a look ?
Please post also which information you will need to help me - I do not want to post huge lists of useless information.
Peter _________________ [1]... AMD Phenon X4-9950 on asus M3N78-EM with 4 GB of RAM - gentoo 10.1 - kernel 2.6.32 - kde 4.3.4
[2]... AMD Athlon XP 2500+ mobile on ASUS A7N8X with 512 kB RAM and 2xTT S-2300 - vdr-1.6.0 based on gentoo-2008.0 |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Sun Oct 11, 2009 12:26 pm Post subject: |
|
|
What does `free -m` output? |
|
Back to top |
|
|
stegerpl Apprentice
Joined: 25 Jun 2005 Posts: 185 Location: 48°19'30"N 14°20'18"E
|
Posted: Sun Oct 11, 2009 4:23 pm Post subject: |
|
|
Hi,
I just edited some images (max. RAM consumption about 3,5 GB) and made some outputs: one before I opened gwenview and GIMP, one after I closed them again (the last one) and four during working:
Code: | minbar rystall # free -m
total used free shared buffers cached
Mem: 3714 844 2870 0 52 323
-/+ buffers/cache: 467 3246
Swap: 5067 0 5067
minbar rystall # free -m
total used free shared buffers cached
Mem: 3714 1749 1964 0 56 577
-/+ buffers/cache: 1116 2598
Swap: 5067 0 5067
minbar rystall # free -m
total used free shared buffers cached
Mem: 3714 1907 1806 0 58 748
-/+ buffers/cache: 1101 2613
Swap: 5067 0 5067
minbar rystall # free -m
total used free shared buffers cached
Mem: 3714 3044 669 0 60 921
-/+ buffers/cache: 2062 1652
Swap: 5067 0 5067
minbar rystall # free -m
total used free shared buffers cached
Mem: 3714 2217 1496 0 61 957
-/+ buffers/cache: 1198 2515
Swap: 5067 0 5067
minbar rystall # free -m
total used free shared buffers cached
Mem: 3714 1540 2173 0 61 965
-/+ buffers/cache: 513 3200
Swap: 5067 0 5067 |
I feel it fills the cache - but I do not know when it should free them again...
Peter _________________ [1]... AMD Phenon X4-9950 on asus M3N78-EM with 4 GB of RAM - gentoo 10.1 - kernel 2.6.32 - kde 4.3.4
[2]... AMD Athlon XP 2500+ mobile on ASUS A7N8X with 512 kB RAM and 2xTT S-2300 - vdr-1.6.0 based on gentoo-2008.0 |
|
Back to top |
|
|
DirtyHairy l33t
Joined: 03 Jul 2006 Posts: 608 Location: Würzburg, Deutschland
|
Posted: Tue Oct 13, 2009 9:29 am Post subject: |
|
|
Not sure what's supposed to be wrong with this output. The second number in the "+/- buffers/cache" line gives you the amount of memory which is available, including the memory the kernel currently uses as I/O cache. Between the last free and the first one, this only differs by some 40MB (which has been supposedly claimed by some other, unrelated process(es)), so this looks fine for me. It's OK if you see less memory available in the "Mem:" line; the kernel will release buffers as needed. |
|
Back to top |
|
|
stegerpl Apprentice
Joined: 25 Jun 2005 Posts: 185 Location: 48°19'30"N 14°20'18"E
|
Posted: Tue Oct 13, 2009 6:13 pm Post subject: |
|
|
Hi,
In this example the effect is not as dramatic as it shows up at other days.
However, The system was rebooted when I made the first snapshot => 844 MB used.
Then I started the applications and after I closed both of them again I took the last snapshot => 1540 MB used
The difference is 696 MB. I can not estimate where they have gone, because it should be (almost) the same situation as before I started the applications.
OK I agree that applications might "waste" some memory or the system will keep some data in caches, but almost 700 MB ?!
On other days this amount reached almost 1.5 GB.
On the other hand I can read that the cached memory increased by 642 MB - that's almost what I am missing.
Maybe I am misreading the information.
Peter _________________ [1]... AMD Phenon X4-9950 on asus M3N78-EM with 4 GB of RAM - gentoo 10.1 - kernel 2.6.32 - kde 4.3.4
[2]... AMD Athlon XP 2500+ mobile on ASUS A7N8X with 512 kB RAM and 2xTT S-2300 - vdr-1.6.0 based on gentoo-2008.0 |
|
Back to top |
|
|
gerard27 Advocate
Joined: 04 Jan 2004 Posts: 2377 Location: Netherlands
|
Posted: Tue Oct 13, 2009 6:32 pm Post subject: |
|
|
Hi stegerpl,
Have you ever noticed the following:
The first time you start an application it takes a certain amount of time before it runs.
You close it and a little while later you start it again and then it starts almost immediately?
I'm no expert at this but I am sure that the application remains in RAM hence the quick restart.
When you don't restart it and the system needs RAM for something else the memory will be freed.
The fact that your swap is barely used proves this.
I have 4G RAM too and deleted swap because it was never used.
Gerard. _________________ To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download |
|
Back to top |
|
|
DirtyHairy l33t
Joined: 03 Jul 2006 Posts: 608 Location: Würzburg, Deutschland
|
Posted: Wed Oct 14, 2009 8:56 am Post subject: |
|
|
Quote: | On the other hand I can read that the cached memory increased by 642 MB - that's almost what I am missing.
Maybe I am misreading the information. |
Yep, you are Looking at the free memory without taking the buffers into account is close to meaningless. The kernel automatically allocates memory for buffers which it frees if it is needed. As gerard82 points out, if you read data from disk, the kernel will keep it in memory until the space it occupies is needed otherwise. This is desired behavior which dramatically speeds up your system in everyday use. The buffers line in the "free" output shows you how much memory is allocated to this kind of cache, and this memory is virtually "as-good-as-free". |
|
Back to top |
|
|
drescherjm Advocate
Joined: 05 Jun 2004 Posts: 2790 Location: Pittsburgh, PA, USA
|
Posted: Wed Oct 14, 2009 5:44 pm Post subject: |
|
|
stegerpl wrote: | Hi,
In this example the effect is not as dramatic as it shows up at other days.
However, The system was rebooted when I made the first snapshot => 844 MB used.
Then I started the applications and after I closed both of them again I took the last snapshot => 1540 MB used
The difference is 696 MB. I can not estimate where they have gone, because it should be (almost) the same situation as before I started the applications.
|
No the difference is 513 - 467 or 46 Mib
Quote: |
Maybe I am misreading the information.
|
You are reading the wrong line. Ignore the first line and only read the -/+ buffers/cache: line as the other user said.
Here is one of my file servers at work that has an uptime of 82 days
Code: | datastore2 ~ # uptime
13:44:33 up 82 days, 48 min, 1 user, load average: 0.10, 0.17, 0.17
datastore2 ~ # free -m
total used free shared buffers cached
Mem: 7460 7419 41 0 0 6746
-/+ buffers/cache: 672 6787
Swap: 4329 0 4329
|
This output tells me out of the 8GB of ram (which 7.4GB are usable) 672 MiB is in use. And ~6.7 GiB is file cache. _________________ John
My gentoo overlay
Instructons for overlay |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9883 Location: almost Mile High in the USA
|
Posted: Thu Oct 15, 2009 7:02 pm Post subject: |
|
|
drescherjm wrote: | This output tells me out of the 8GB of ram (which 7.4GB are usable) 672 MiB is in use. And ~6.7 GiB is file cache. |
Curious what chipset you're using, seems like this is not an Intel enterprise server chipset as they should be able to address all 8G plus io... Is it perhaps like a G965 or P43 or something in that caliber? (Well, bad assumption of it being Intel, could be AMD or Sun or something too I guess.) _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
drescherjm Advocate
Joined: 05 Jun 2004 Posts: 2790 Location: Pittsburgh, PA, USA
|
Posted: Thu Oct 15, 2009 7:06 pm Post subject: |
|
|
This is a desktop ASUS AM2 M2N board that is over 3 years old. The chipset is nForce4 but since the AMD CPU has the memory controller inside I do not believe the fault is with the nforce. Generally now all of our new file servers are $700 dual or quad core desktops with 8 to 10 harddrives using linux software raid 5 or 6.
Actually my XP 64 desktop that I am typing on now has the same mobo and cpu and it says is using all 8GB. I am not sure of the reason why I do not get all the ram under x86_64. _________________ John
My gentoo overlay
Instructons for overlay |
|
Back to top |
|
|
|