You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by tobe <to...@swipnet.se> on 2003/07/13 10:25:22 UTC

resources (was Re: Location of InDepth Understanding of JAMES)

>>Also, I have several questions concerning how James "holds" a
>>message while the mailets process.  For instance, does James load
>>an entire message, including an attachment, while it decides if a
>>user even exists or does it simply read the the SMTP header?
>>    
>>
>
>Basically? Yes.
>James creates a Mail object which includes a MimeMessage object which does
>indeed include the whole message.
>This is then passed from mailet to mailet through the processors until it is
>finished with.
>The other way, to only load the headers, would require some advance
>knowledge about what matchers and mailets intend to do, which we can't get.
>I would wholeheartedly support a good resource optimised way of handling
>messages, but fear that that is probably not practical without compromising
>the general flexibility of James.
>
>  
>
If it was important enough, one could always build a lazy-loading 
MimeMessageProxy.

Then you need to know in configuration which mailet uses what so that 
you could optimize flow.

You would need to consider whether content stays in memory once it has 
been loaded or if it should get released. In Java the rule used to be 
that you should have either short-lived objects or long-lived objects, 
not objects with medium life-span (longer than one gc-cycle), else 
garbage collection takes longer (if processor power is a short resource).

/tobe


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: resources (was Re: Location of InDepth Understanding of JAMES)

Posted by "Noel J. Bergman" <no...@devtech.com>.
> > James creates a Mail object which includes a MimeMessage object
> > which does indeed include the whole message.
> > This is then passed from mailet to mailet through the processors until
it is
> > finished with.

> > If it was important enough, one could always build a lazy-loading
> > MimeMessageProxy.

See MimeMessageWrapper.  There will likely be additional work to clean up
the current wrapper, but it does provide lazy loading.

> Then you need to know in configuration which mailet uses what so that
> you could optimize flow.

That would be an administative concern, but the code doesn't care.
MimeMessageWrapper will load headers whenever something asks for the
message's headers, and will load the body (the entire body) whenever
something asks for part of the message contents.

> You would need to consider whether content stays in memory once it has
> been loaded or if it should get released.

The Mail object, and the MimeMessage(Wrapper) are released between
processors.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org