
	an rough estimation of the memory usage of Open WebMail
	=======================================================

At first, the program itself takes at least 5.5 MB...:(


folder view
===========
The memory usage in the folder view is proportional to the message count
in the mail folder, but it grows very little as message counts increases.
It is about

	5.5MB(main) + message_count * 0.2k


read a message
==============
There are 2 stages here:

a. To get the message showed on your browser, Open WebMail CGI needs
   to parse the whole message to determine how to display the message
   header, body and all attachments. Then it returns the html page and
   the CGI process terminates. Memory usage at this stage is

   	5.5MB(main) + message_size

b. When the browser gets the html page, it will request all inline
   images embedded in this page. Each images will cause one CGI process.
   Memory usage for each CGI process will be

   	5.5MB(main) + message_size + 2 * attachment_size

   When the image transferring is starting, the memory usage will down to

   	5.5MB(main) + message_size + attachment_size


ps: Most browser will request at most 4 images simultaneously.

example:

We have a message with 5 attachments and each attachment is 1MB in size,
3 of them are graphics and 2 of them are Ms-word docs.

At stage (a), the memory usage is

	5.5(main) + 5 = 10.5 MB

At stage (b), each image takes

	5.5(main) + 5 + 2*1 = 12.5 MB

Since there are 3 images in the message,
so the total memory usage for stage (b) will be

	12.5 * 3 = 37.5 MB

If we consider the shared library and code page sharing support on
most unix, some of the 5.5MB part of each CGI process may shared with
others. So the total memory usage will be somewhat less than the above.

And if user clicks the link of word docs for download,
the memory usage will be

	12.5 MB


send a message
==============
There are also 2 stages in the sending of message

a. the user attaches an attachment to the message
b. the user presses the [send] button to send the whole message.

The memory usage for these 2 stages has no relation with the
message or attachment size. It is about 5.5 MB.


Conclusion
==========
Amazing? Yes, this program is a memory hog.....
You'd better install more ram on your webmail server to make it faster...

ps: Since version 1.90 20030313, openwebmail can work with SpeedyCGI,
    the speed is much much faster because of persistent running,

    And memory usage will be greatly reduced when serving multiple
    concurrent requrests because of unix copy-on-write :)
    You can get a quite reactive webmail system on a P133/64Mb machine :)


03/13/2003

openwebmail.AT.turtle.ee.ncku.edu.tw
