I seem to have a problem with the amount of stuff in swap file. I’ve got two GB of RAM, but after several days of running I’ll have a huge amount of stuff in the swap file–as much as 3-400 MB, even though I’m not anywhere near to using all of my RAM (using maybe 400 MB). If I shut down all my apps–right now the only apps running are Firefox, System Monitor, and my wireless–I still have 167 MB in swap, even tho RAM is only at 20% (400MB).
This seems to be an invitation for thrashing and to unnecessarily slow down my computer. Is it a memory leak problem?
now, i know those are all actually focused on the use of memory (as in
RAM) but i point it out so if you now understand how linux uses RAM
and note that your RAM is not even near full then you know that what
is in swap is not going to cause any thrashing until RAM is completely
full and in use…otherwise, the stuff in swap is just gonna sit
there just-in-case the kernel needs/wants it again (which is why it is
there, the kernel “decided” to keep it there, for reasons above my
level of understanding)…
–
DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]
When it comes to chocolate, resistance is futile.
Thanks. That’s reassuring. I’ll check the threads. I was looking for info with search terms like ‘swap file memory problem’ etc and not focusing on RAM searches.
On 2010-09-30 14:06, SuseNeo wrote:
>
> I seem to have a problem with the amount of stuff in swap file. I’ve got
> two GB of RAM, but after several days of running I’ll have a huge amount
> of stuff in the swap file–as much as 3-400 MB, even though I’m not
> anywhere near to using all of my RAM (using maybe 400 MB). If I shut
> down all my apps–right now the only apps running are Firefox, System
> Monitor, and my wireless–I still have 167 MB in swap, even tho RAM is
> only at 20% (400MB).
>
> This seems to be an invitation for thrashing and to unnecessarily slow
> down my computer. Is it a memory leak problem?
No, it is a good thing. It means the system has freed 167 MB that it doesn’t need and pushed it to
swap. Your computer will actually run faster
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)
I regularly use hibernate. When openSUSE restarts from hibernate, does it just leave all that stuff in the swap file? It seems to me that it would slow things down? (It may be “subjective,” but it seems to me that my system runs a lot slower when there’s all that stuff in the swap file.)
It may leave the image. In general unless you are using a lot larger process then you indicate the normal operations should never touch the swap. And in any case you you still have swap left. So my guess is that it is all in your head. But you could test by rebooting and trying a given set of operations with a stopwatch then suspend and try the same set again.
On 2010-09-30 17:36, SuseNeo wrote:
>
> I regularly use hibernate.
Then it is normal.
> When openSUSE restarts from hibernate, does
> it just leave all that stuff in the swap file? It seems to me that it
> would slow things down? (It may be “subjective,” but it seems to me
> that my system runs a lot slower when there’s all that stuff in the swap
> file.)
Things are slow for a while: the first time “something” is needed, that is supposedly running from
before you hibernated, it is recovered from the disk - but this is faster than if you had booted
completely, and had to start all your aps, load things, etc. The total time is less.
What remains in swap are the parts that are not needed again.
Programs have sections that run once at start and never again. As an effect of hibernation,
everything is sent to the swap - but as these sections do not actually run again, they remain there.
Which is good. Why do you need to have in memory things that you do not use? It is better to have
that memory available for something that really needs to be used.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)
I think that’s exactly why your swap file is larger than normal. Swap is used for a number of things one of which is to contain the memory pages for hibernation. I don’t think the swap file is cleared when returning from hibernation.
On 2010-09-30 21:36, tararpharazon wrote:
>
> I think that’s exactly why your swap file is larger than normal. Swap
> is used for a number of things one of which is to contain the memory
> pages for hibernation. I don’t think the swap file is cleared when
> returning from hibernation.
Cleared? You mean erased, reformatted? Of course not.
Areas that are sent to memory are marked as such, thus “available”, not in use. Free.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)