No if you look for "makeBody" you'll see where it fills the body.  It  is not 
entirely shocking that a 3MB message would blow a 40MB heap with the default 
JBoss install as JBoss takes nearly a 32MB heap if you do no other 
configuration.  

"
            body = new byte[calculateBodySize(bodyList)];
            body = makeBody(bodyList,body);
"

Advanced heap protection will require a seperate mbean (names in below 
pseudocode are demonstrative but stupid):

BodyStore store = BodyStoreService.newBodyStore();

storeid = store.getId();
BodyOutputStream stream = store.getOutputStream();

stream.takeInput(inputStream);
this.bodyStrore = bodyStore;

Then getBodyAsInputStream should be added to Mail:

if (bodyStore == null) {
   return new ByteArrayInputStream(body);
} else {
   return BodyStore.getInputStream();  
}

BodyStore should have two implementations: File-based and Database.  The file 
based simply create a new file for every body with some kind of integer naming 
scheme.  

The database one will be more complicated.  I'm going to say something 
shocking....it probably is easiest to just not use a persistence engine (no 
hibernate/cmp) and implement our own database transparency layer.  I'll 
explain, CLOB/BLOB is still not very well standardized.  The MYSQL driver even 
fakes it so far as actual locators are concerned.  Oracle can support locators, 
but you have to use oracle specific types.  I suggest that we support Oracle, 
MySQL and the JDBC3 version.  This will make installation more complicated as 
we'll have to have a way to create the table with the BLOB/CLOB.

-Andy

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3860318#3860318

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3860318


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to