From: avi@...4.com (Avi Bryant) Date: 2004-02-03T08:55:06+09:00 Subject: Re: Borges/Iowa resource usage Chris Morris wrote in message news:<401EAC45.3090604@clabs.org>... > Kirk Haines wrote: > > >With Iowa, > >on a Linux (RedHat) box, my resident set size for the app that is handling > >the large dual mapped content mutual fund website is about 13.5 meg. > > > > > How does Iowa store each continuation stack (which is my own, uneducated > term -- same thing as the resident set size?) ? From my unscientific > checking of Borges, it seemed each continuation got its own place in > memory, so virtually every page visit triggered another usage chunk, and > it seemed to grow very quickly with just one user. If Eric's reading > this (Borges author), maybe he can chime in with some more specifics. Iowa (at least back when I first wrote it ;) doesn't use continuations, although it's still resource intensive compared to many alternatives, because it stores a bunch of state for each page view. But as Kirk shows, it stays within acceptable limits. Chad Fowler and I were looking into Borges resource usage earlier today, and it seems to be out of control - Chad was seeing about an extra 1MB (!) of resident size per page view. I did some simple benchmarks and it does appear that Ruby uses an awful lot of memory while capturing continuations (I calculate about 6k per stack frame), but this seems to be temporary and goes away after a GC, even if you hang onto the continuation itself. GC doesn't seem to help much with Borges. As an indication of what I would expect from a Borges-like framework, the Squeak version of Seaside tends to use about 100-300k per concurrent user. Not insignificant, but fairly manageable. It's always interesting to see what happens to one's work. I wasn't involved at all in the development of Borges (beyond picking the name ;) - I wasn't fully aware of the work Eric was doing until I saw his RubyConf slides. Eric told me after he finished the port that there were cases where he didn't really understand what was going on, but just copied verbatim what I had done in Smalltalk. It wouldn't surprise me if rewriting Borges from first principles in idiomatic Ruby made some of these problems go away (though of course, my ideas about what these "first principles" might be are always evolving...). If this style of framework is interesting to people (and it seems to be), I'd be willing to help some folks start fresh and "do it right". Cheers, Avi