2001-10-19 07:39:08

by Leeuw van der, Tim

[permalink] [raw]
Subject: Case where VM of 2.4.13pre2aa falls apart

Hello,

I've observed a case where the VM of 2.4.13pre2aa totally falls apart. I
know it's not the latest of Andrea's VM tweaks, but I didn't yet get a
chance to compile&reboot into a later version. I've noticed a similar
breakdown in one of the first pre-release kernels with the Andrea VM, btw.

Unfortunately I don't have any numbers, so it's just a story. I guess it
would be useful to run vmstat in the background, at least from time to time?
Anything else that could give useful information?

Anyways.

In the evening I was browsing the web with Mozilla, and I was trying to
compile a newer kernel. This went quite smooth. In the morning before going
to the office, I did apt-get dist-upgrade of the system with Mozilla still
running on another desktop.
In the evening I came back, checked the result of this system upgrade; the X
server and terminal windows on that desktop were totally responsive. Mozilla
had an RSS of around 2.5Mb, and about 18Mb in swap according to top. Not
unusual after such activity.

Then I switched to the desktop with Mozilla and everything fell apart.
Mozilla, which hadn't been used for nearly 24 hours, had big trouble to get
going again. Once it displayed it's interface again (instead of a black
window) it took forever get it to respond to mouseclicks. At this time the X
server and windowmaker started stuttering too. I switched back to the
desktop with terminal windows, they were responsive except for the
stuttering X server. I noticed in top that Mozilla's RSS was about half of
what it normally was, and going down again.
Switching back to the Mozilla desktop again it had a black window, as if it
was mostly swapped out again. For several minutes it was really hard to do
anything with Mozilla, the system was constantly busy with it's disks and (I
guess) constantly paging things in and out. After it became useable, it was
still not smooth.
The rest of the evening I didn't have a chance to touch the computer again;
in the weekend I'll try to gather more useful data.

It seems that Mozilla was severely punished for not being used for such a
long time, and had to fight very very hard to earn a place back in memory. I
was not doing anything else with the computer in the evening, I wasn't
compiling. The evening before everything was smooth while compiling, now it
was pathological while not doing anything.

I noticed that the cache was very small, but I can't remember of it was
around 4.5Mb or 8Mb, sorry! In any case, much lower than in older version of
2.4kernels where it was usually around 16Mb, 20Mb or even more. I don't know
what is counted towards the cache in top? Just datafiles, or also
executables and shared libraries which are loaded?


In an earlier version of the Andrea VM I had a similar case: At night I
logged in to Gnome, with nautilus running in background, and did some
browsing with Galeon. In the morning I wanted to do something at the
computer, after it had been idle all night and running it's cron jobs. I
opened a nautilus window, and wanted to browse the web a bit. I was unable
to do either of them; it was a disaster. Of course, this is with two
memory-hogs running at the same time. But I've gotten faster response from
the computer under worse memory stress.


In conclusion, it really seems to me that the VM of Andrea performs
wonderful when you boot and start working, but when you give the system a
chance to swap out your programs (running apt-get upgrade, cron jobs with a
lot of find and updatedb, etc) the VM falls apart completely when you want
to return to those programs. What was before a beautifully smooth workingset
is now unable to get back into memory and become smooth again until after
you try for 10, 15, 20 minutes.
I don't recall it ever being that bad.

I will try Rik's VM whenever I get a chance for behaviour under similar
circumstances. Meanwhile, I'm open to any hints that ppl can give me on how
to collect the most useful statistics without overkill (24 hours worth of
continuous vmstat-output is probably worthless because it's too much).

with regards,

--Tim



2001-10-19 20:44:04

by Jose Luis Domingo Lopez

[permalink] [raw]
Subject: Re: Case where VM of 2.4.13pre2aa falls apart

On Friday, 19 October 2001, at 02:39:00 -0500,
Leeuw van der, Tim wrote:

> Hello,
>
> I've observed a case where the VM of 2.4.13pre2aa totally falls apart. I
> know it's not the latest of Andrea's VM tweaks, but I didn't yet get a
> chance to compile&reboot into a later version. I've noticed a similar
> breakdown in one of the first pre-release kernels with the Andrea VM, btw.
> [...description of problem apparently related to Mozilla ...]
>
Maybe what happens here doesn't have anything in common with what you
experienced, but a couple of days ago I suffered a full X server crash due
to a _big_ memory leak with Mozilla in one specific web page.

Linux kernel 2.4.12, Mozilla 0.9.5, and X 4.1.0. Open
http://www.securityfocus.org with Mozilla. For a couple of minutes, it seems that
all is going on nicely. Afterwards, and without any kind of user
interaction with Mozilla, both mozilla and X processes start increasing
their sizes, slowly, but steadily.

After some minutes of memory "leaking", either Mozilla crashes itself (no
OOM as far as /var/log/kern.log says), leaving X process with a big SIZE
(the same it had just before Mozilla crashed), or the whole X session
crahses.

Bug number 101461 on bugzilla.mozilla.org describes this problem with
Mozilla and http://www.securityfocus.org. Maybe this behaviour can be triggered
from some other web sites, and maybe it doesn't have anything in common
with your problems, but maybe it is worth a try.

--
Jos? Luis Domingo L?pez
Linux Registered User #189436 Debian Linux Woody (P166 64 MB RAM)

jdomingo EN internautas PUNTO org => ? Spam ? Atente a las consecuencias
jdomingo AT internautas DOT org => Spam at your own risk

2001-10-22 12:12:09

by Andrea Arcangeli

[permalink] [raw]
Subject: Re: Case where VM of 2.4.13pre2aa falls apart

On Fri, Oct 19, 2001 at 10:47:21PM +0000, Jos? Luis Domingo L?pez wrote:
> On Friday, 19 October 2001, at 02:39:00 -0500,
> Leeuw van der, Tim wrote:
>
> > Hello,
> >
> > I've observed a case where the VM of 2.4.13pre2aa totally falls apart. I
> > know it's not the latest of Andrea's VM tweaks, but I didn't yet get a
> > chance to compile&reboot into a later version. I've noticed a similar
> > breakdown in one of the first pre-release kernels with the Andrea VM, btw.
> > [...description of problem apparently related to Mozilla ...]
> >
> Maybe what happens here doesn't have anything in common with what you
> experienced, but a couple of days ago I suffered a full X server crash due
> to a _big_ memory leak with Mozilla in one specific web page.
>
> Linux kernel 2.4.12, Mozilla 0.9.5, and X 4.1.0. Open
> http://www.securityfocus.org with Mozilla. For a couple of minutes, it seems that
> all is going on nicely. Afterwards, and without any kind of user
> interaction with Mozilla, both mozilla and X processes start increasing
> their sizes, slowly, but steadily.

It certainly makes sense it's the userspace that has a leak and so the
system will start to swap and slowdown compared to the condition when
lots of free memory was available.

Andrea

2001-10-23 07:17:42

by Leeuw van der, Tim

[permalink] [raw]
Subject: Re: Case where VM of 2.4.13pre2aa falls apart

> On Fri, Oct 19, 2001 at 10:47:21PM +0000, Jos? Luis Domingo L?pez wrote:
> > On Friday, 19 October 2001, at 02:39:00 -0500,
> > Leeuw van der, Tim wrote:
> >
> > > Hello,
> > >
> > > I've observed a case where the VM of 2.4.13pre2aa totally falls apart.
I
> > > know it's not the latest of Andrea's VM tweaks, but I didn't yet get a

> > > chance to compile&reboot into a later version. I've noticed a similar
> > > breakdown in one of the first pre-release kernels with the Andrea VM,
btw.
> > > [...description of problem apparently related to Mozilla ...]
> > >
> > Maybe what happens here doesn't have anything in common with what you
> > experienced, but a couple of days ago I suffered a full X server crash
due
> > to a _big_ memory leak with Mozilla in one specific web page.
> >
> > Linux kernel 2.4.12, Mozilla 0.9.5, and X 4.1.0. Open
> > http://www.securityfocus.org with Mozilla. For a couple of minutes, it seems
that
> > all is going on nicely. Afterwards, and without any kind of user
> > interaction with Mozilla, both mozilla and X processes start increasing
> > their sizes, slowly, but steadily.
>
>
> It certainly makes sense it's the userspace that has a leak and so the
> system will start to swap and slowdown compared to the condition when
> lots of free memory was available.
>
>

It doesn't seem likely to me, as the total size of Mozilla was about 20Mb or
22Mb then, swap + RSS. I've gotten better performance with Netscape
exploding to +100Mb.

I've actually observed more weird slowdowns. The 'morning after' syndrome
I've described previously and lengthily doesn't always occur, there are
plenty of mornings where it actually picks up with good performance.
But the other day I upgraded again with apt-get dist-upgrade and dpkg hardly
managed to make any progress at all, with very low CPU useage for dpkg and
the system overal and (iirc) spinning disks.
General overal performance wasn't really hampered and starting up a
kernel-compile seemed to slightly improve the speed of dpkg.

Of course, this can all be coincidence, and it probably depends on many
factors. It could even be something very specific in a coupe of the scripts
that dpkg was running. However, it was highly uncharacteristic for dpkg and
apt-get upgrade. (dpkg is quite a memory and CPU hog btw when upgrading
packages).

As if the system sometimes penalizes certain processes, and sometimes picks
the wrong one. Is there anything in the kernel to penalize processes in some
way, based on process-behaviour?

This was still running 2.4.13pre2aa btw, I hadn't yet booted into pre3aa.
Uptime was over 4 days. I don't know if this uptime makes a difference?

I'm sorry for having so many vague descriptions and so little time to
experiment and collect data!


--Tim


> Andrea
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

> the body of a message to [email protected]
> More majordomo info at <http://vger.kernel.org/majordomo-info.html>
> Please read the FAQ at <http://www.tux.org/lkml/>
>
>
> _____