On Friday, September 19, 2003, at 04:20 PM, Ben Parker wrote:
The memory is shared across all threads in the process. So even though top
or ps will show you multiple threads each supposedly consuming 40Mb, it's
actually just 40Mb total for the whole process. Webware itself is pretty
slim on RAM, but of course your own servlets will likely import other code
that increases the memory usage.


Webware can also hold onto objects via its cache. If you use servlet instance variables and you don't want those variables to persist after the request is finished, you should do something like:

    def sleep(self, trans):
        self._myVar = None # for whatever variables you set
        Page.sleep(self, trans)

This is a sort of soft memory leak that can be common in garbage collected languages, where you hold onto references you no longer care about.

I don't know if this is terribly common in Servlets, though -- at most I usually set a couple flags, and flags and the sort don't take up large amounts of memory. Imported modules probably take up much more memory.

Ian



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to