[plt-scheme] Massive memory consumption

From: Pete.4479779 at bloglines.com (Pete.4479779 at bloglines.com)
Date: Mon Nov 1 19:19:31 EST 2004

--- Arend P. van der Veen" <apvanderveen at att.net wrote:
> Hi,
> I am
having some concerns after reading this thread.   We are developing 
> an
application that uses the PLT web server that is schedules to go live 
by then end of the year and we are relying heavily on continuations.

like to reiterate that my tests were specifically targeting Continue, which
is a conference-management application. It is unusual for a web application
because it only has a small number of users (20 max, pretty much) and is guaranteed
to only run for a few months at the most (the length of a single conference
review period). I wanted to see if I could run it without timing out continuations.

I'd suggest, if you're curious, to try some tests that better reflect the
load and circumstances you're expecting. You'll probably use timeouts on your
continuations, which will make your memory use patterns dramatically different
from mine.

> I was also wondering if anybody had any recommendations on
how to use 
> the PLT web server in a production environment.

My experience
with the server is that it is quite stable. I've only experienced one unexpected
shutdown of the server, and I'm 95% certain that the cause of that was not
the server but ssh and nohup.

> To specifically address memory consumption
we are considering rebooting 
> the PLT Web server process once a day.  
Will this help reduce memory 
> consumptions and improve stability?   Do
I need to reboot the server and 
> not just the PLT Web server process?

You should test this, but, if you time out your continuations, the 3m collector
should let you run indefinitely in a finite amount of memory. Boehm may leak,
I'm not sure how much. (In my tests, any Boehm-leaked memory was inconsequential
compared to the growing live memory.) Remember that the severe performance
problems I found with 3m were only after physical memory was exhausted. (Though
Boehm gave a bit better performance even before then. But that might have
been fixed, according to Adam.)

> I was also wondering if there was any
way that I can detect if the PLT 
> web server has any open sessions ?  I
do not want to restart the process 
> or server if there are any active sessions.

This is one of those impossible web problems. In general you can't know
if a session is "active" because you don't know if a user will come back.
This is why garbage collection of continuations has to be done based on timeouts.

As for knowing if there are any non-timed-out continuations, I don't think
the server exposes that. You could probably get the same result yourself my
keeping track of the time of the last access to your web application, however.

> Adam Wick wrote:
> >   For list-related administrative tasks:
> >
> > 
> > At 31 Oct
2004 17:50:36 -0000, Pete.4479779 at bloglines.com wrote:
> > 
> >>The 3m collector
had slightly higher memory use
> >>and significantly lower performance when
memory grew tight. After 1500 hits:
> > 
> > 
> > You might find more recent
versions of the default collector 
> > function better under load. At least,
that was the intent of
> > that re-write (it popped into the archive in early
> > and it was v299-, not exp-tagged then). I'm not sure if it'll

> > help the space usage problem. It might, but I haven't run any
> > experiments.

> > 
> > I've got fixing some of the memory use problems on my todo list,

> > but I've got a bunch of other things on my plate with a higher
> > priority.
So I don't know when (or even if) I'll have some time
> > to go ahead and
work on it. 
> > 
> > 
> > -Adam
> > 

Posted on the users mailing list.