[plt-scheme] web-server memory use

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Apr 30 09:50:51 EDT 2007

At Mon, 30 Apr 2007 14:36:14 +0100, Dave Gurnell wrote:
>    - I printed the custodian's memory use in instance-lookup:
>      (printf "Memory use: ~a~n" (current-memory-use (instance- 
> custodian instance)))
> This prints 0 each time.

There may be a sibling custodian that can reach all of this custodian's
objects, and the sibling happens to get charged. For example, it seems
likely to me that servlets have many references to data that belongs to
the server, and the server itself keeps a list of all servlets, so that
(in GC terms) you can get from any servlet to all data. Consequently,
one servlet would get charged for everything, and the rest would get
charged nothing. That's a guess, but probably a good one. :)

In other words, custodian-based memory accounting doesn't "just work",
unfortunately. Our experience so far is that adapting programs to make
accounting work is fairly easy, but it requires some attention. In
DrScheme, for example, we had to adjust 5 or so references, so that
DrScheme refers to user programs only via custodians, threads, and weak
references. I don't know that it will be as easy in the case of the web
server; it should be an interesting experiment, but it's probably more
than you want to try right now.


Posted on the users mailing list.