On Fri, 30 Sep 2005 11:08:09 -0700, "Anthony F" eatme444@hotmail.com wrote:
Perhaps "Leak" was too strong a word. I'm not sure exactly what is going on yet, but here are the symptoms:
I start Apache, then TBNL. I hit the test page with Firefox. While watching the Process tab in Task Manager I follow a link. Memory usage on the LispWorks process jumps anywhere from 2 to 5 megs. Following any other links within the test app or refreshing the page causes the same until I hit LispWorks Personal's heap size limit and it dies.
I have yet to check if restarting Apache fixes the problem, but I will report on that later. HOWEVER, I notice that even with IE a very small amount of memory seems to be leaking? If you hit the Test app from IE, follow a link and/or repeatedly refresh I notice memory usage on the LispWorks process creep upwards ever so slowly.
Having said this, I have not actually done any real investigating yet (like I said, I'm a total newb)... so this may or may not be a result of expected behavior.
I've just experimented with this myself a little bit and I have to admit that TBNL on LispWorks does indeed seem to "leak" memory in that the size of the LW application grows continuously without shrinking again - on Linux as well as on Windows. It turns out that a lot of this is due to the external format code I introduced in 0.8.0 which uses the FLI. In particular, there's a call to SYS:IN-STATIC-AREA in there which I guess is the culprit. It was my understanding that these statically allocated objects are subject to normal garbage collection but it looks as if new static segments are allocated all the time. As the LW reference manual says: "Such additional segments would cause the application to grow irreversibly."
But even pre-0.8.0 TBNL on LW "leaks" a bit. It looks like at least under heavy load the higher generations tend to grow so one should probably call MARK-AND-SWEEP from time to time.
I'm a bit too busy right now to investigate this further but maybe someone else wants to look at it and fix it.
On a seperate note: I don't really want to start a mod_lisp vs. other options war, but is anyone using a Lisp server (AllegroServer, TBNL's server, etc) back end in a production environment? I was wondering about performance, security, other issues, etc. Personally, I feel "safer" using Apache as it's battle hardened and fairly ubiquitous, but maybe those feelings are unfounded? Any comments?
I don't think there's a reason to assume that Lisp servers are inherently less secure than Apache, actually I tend to think that there are a lot of "typical" security holes that you'll see in a C/C++ app but not in a Lisp app.
As fas as performance is concerned I'm pretty sure that Lisp servers are definitely "fast enough." If one of the websites I'm maintaining should really ever have so much traffic that it hits the performance limits one can see when benchmarking Apache/mod_lisp/TBNL I'd be very happy... :)
Having said that - there aren't many Lisp web servers out there that fully implement HTTP/1.1 and you certainly want that if you're serving production web sites. TBNL stand-alone doesn't do HTTP/1.1 and Araneida doesn't do it either AFAIK. AllegroServer does, though, and it has been used successfully in production environments like these:
http://www.pandorabots.com/ http://www.franz.com/
Another example for a Lisp web server used in a production environment, although a bit dated, is the White House Electronic Publications server which was running atop CL-HTTP when Clinton was still in office. CL-HTTP is also HTTP/1.1-compliant, BTW. It just has a somewhat peculiar license.
Cheers, Edi.