You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Norman Maurer <nm...@byteaction.de> on 2006/06/02 12:05:11 UTC

Re: [jira] Commented: (JAMES-512) OutOfMemoryError -- object not released.

Before applied the patch of Stefano or after ?

bye
Norman

Am Freitag, den 02.06.2006, 09:48 +0000 schrieb Bernd Fondermann (JIRA):
>     [ http://issues.apache.org/jira/browse/JAMES-512?page=comments#action_12414390 ] 
> 
> Bernd Fondermann commented on JAMES-512:
> ----------------------------------------
> 
> a db configuration runs into memory problems (Xmx=64m) after less than two hours, too.
> 
> (this is a setup where 500 mails are created per minute, which is quite a load: 30 000 mails/hr!)
> 
> 
> 
> 
> 
> 
> > OutOfMemoryError -- object not released.
> > ----------------------------------------
> >
> >          Key: JAMES-512
> >          URL: http://issues.apache.org/jira/browse/JAMES-512
> >      Project: James
> >         Type: Bug
> 
> >   Components: MailStore & MailRepository
> >     Versions: 2.2.0
> >  Environment: windows XP,
> > Java 1.5.0_06
> >     Reporter: Quande Ren
> >     Assignee: Noel J. Bergman
> >     Priority: Critical
> >      Fix For: 2.3.0a4
> >  Attachments: james-512.patch, picture.GIF
> >
> > I use the file system to store the emails.
> > When I run the James for a long time, the james server used more and more heap memory, eventually it runs out of memory and refuse to receive email. only restart the james will work.
> > I used JProfile Memory Debugger(you can get the trial version from www.quest.com)  and found a clue. the object allocated from following code at line 92 does not always get released, cause the memory been used up eventually. I will attach a picture file showing the call stack.
> > 91,            final OutputStream outputStream = getOutputStream( key );
> > 92,            final BufferedOutputStream stream = new BufferedOutputStream( outputStream );
> > 93
> > 94,            final Object o = m_outputs.get( key );
> > 95,            if( null == o )
> > 96,            {
> > 97,                m_outputs.put( key; stream );
> > 98,            }
> > 99,            else if( o instanceof ArrayList )
> > 100,            {
> > 101,                ( (ArrayList)o ).add( stream );
> > 102,            }
> > 103,            else
> > 104,            {
> > 105,                final ArrayList list = new ArrayList();
> > 106,                list.add( o );
> > 107,                list.add( stream );
> > 108,                m_outputs.put( key; list );
> > 109,            }
> > 110
> > 111,            return stream;
> 

Re: [jira] Commented: (JAMES-512) OutOfMemoryError -- object not released.

Posted by Bernd Fondermann <bf...@brainlounge.de>.
Ok, didn't know what you were referring to and felt my JIRA comments 
needed to be put in context.

I'd like to share one additional interesting observation:
from previous test runs it seem to me that memory is be more or less 
constant if the number of unmatched mails at any given point in time has 
an upper limit.

but in this situation here, the number of unmatched mails grows without 
signs of convergence before the OOM exceptions are coming up.

If I am correct in saying that the sent but unmatched mails are those 
sitting in the spool, it would be a goal to "make the spool more 
scalable", whatever that means in the end...

   Bernd

Stefano Bagnara wrote:
> Bernd Fondermann wrote:
> 
>> Stefano Bagnara wrote:
>>
>>> My patch should has nothing to do with db repositories. So I think 
>>> this doesn't matter.
>>
>> [...]
>> that's the whole point of comparing file-repo with non-file-repo under 
>> the same conditions and the result is: db-repo has similar 
>> problems/symptoms. (and that's why it matters to repeat the tests with 
>> db repos.)
> 
> 
> Just to avoid misunderstandings my "it doesn't matter" was a reply to 
> Norman's "Before applied the patch of Stefano or after ?".
> 
> I completely agree with your analysis: we should close JAMES-512 and 
> eventually open a new bug with more information about the probable bug 
> you are describing now.
> 
> Imho it should be tested with more memory before opening a new bug. If 
> it is a leak it will happen even with Xmx set to 256 or 512MB, otherwise 
> maybe it is simply a requirement (maybe related to a bad usage of 
> memory, but if so it is less critical).
> 
> Stefano
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
> 
> 


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


Re: [jira] Commented: (JAMES-512) OutOfMemoryError -- object not released.

Posted by Stefano Bagnara <ap...@bago.org>.
Bernd Fondermann wrote:
> Stefano Bagnara wrote:
>> My patch should has nothing to do with db repositories. So I think 
>> this doesn't matter.
> [...]
> that's the whole point of comparing file-repo with non-file-repo under 
> the same conditions and the result is: db-repo has similar 
> problems/symptoms. (and that's why it matters to repeat the tests with 
> db repos.)

Just to avoid misunderstandings my "it doesn't matter" was a reply to 
Norman's "Before applied the patch of Stefano or after ?".

I completely agree with your analysis: we should close JAMES-512 and 
eventually open a new bug with more information about the probable bug 
you are describing now.

Imho it should be tested with more memory before opening a new bug. If 
it is a leak it will happen even with Xmx set to 256 or 512MB, otherwise 
maybe it is simply a requirement (maybe related to a bad usage of 
memory, but if so it is less critical).

Stefano


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


Re: [jira] Commented: (JAMES-512) OutOfMemoryError -- object not released.

Posted by Bernd Fondermann <bf...@brainlounge.de>.
Stefano Bagnara wrote:
> My patch should has nothing to do with db repositories. So I think this 
> doesn't matter.

quick recap of my conclusions around JAMES-512:

a specific problem with file-repos was reported and your fix was applied.

after the fix, the problem symptoms (OOMs) don't completely go away, 
they only come appearant later.

so, the fix seems to help, but presumably doesn't make the problem go 
away. (another possibility is, that it's a completely different problem 
with similar symptoms.)

at this time, the question should be posed: is it still only a file-repo 
problem, or a more general problem?

that's the whole point of comparing file-repo with non-file-repo under 
the same conditions and the result is: db-repo has similar 
problems/symptoms. (and that's why it matters to repeat the tests with 
db repos.)

knowing this, JAMES-512 could be closed because it reports only a very 
specific memory leak.

next, we could open a new JIRA or could conclude that handling 500 
mails/min really needs more memory than 64MB.

> Instead I would like to know wether this is derby or mysql or anything 
> else?

> I know many connector/j uses big buffers and maybe they also have leak 
> problems. Derby instead have big caches, maybe it is a leak or maybe we 
> simply have to tune derby parameters (like we already did)

I used default derby.

   Bernd

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


Re: [jira] Commented: (JAMES-512) OutOfMemoryError -- object not released.

Posted by Stefano Bagnara <ap...@bago.org>.
My patch should has nothing to do with db repositories. So I think this 
doesn't matter.

Instead I would like to know wether this is derby or mysql or anything else?

I know many connector/j uses big buffers and maybe they also have leak 
problems. Derby instead have big caches, maybe it is a leak or maybe we 
simply have to tune derby parameters (like we already did)

Stefano

Norman Maurer wrote:
> Before applied the patch of Stefano or after ?
> 
> bye
> Norman
> 
> Am Freitag, den 02.06.2006, 09:48 +0000 schrieb Bernd Fondermann (JIRA):
>>     [ http://issues.apache.org/jira/browse/JAMES-512?page=comments#action_12414390 ] 
>>
>> Bernd Fondermann commented on JAMES-512:
>> ----------------------------------------
>>
>> a db configuration runs into memory problems (Xmx=64m) after less than two hours, too.
>>
>> (this is a setup where 500 mails are created per minute, which is quite a load: 30 000 mails/hr!)


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


Re: [jira] Commented: (JAMES-512) OutOfMemoryError -- object not released.

Posted by Norman Maurer <nm...@byteaction.de>.
Right just see.. only FileRepositories ..
Sometimes first thinking then writing is the best solution ;-)

bye
Norman

Am Freitag, den 02.06.2006, 12:48 +0200 schrieb Stefano Bagnara:
> My patch should has nothing to do with db repositories. So I think this 
> doesn't matter.
> 
> Instead I would like to know wether this is derby or mysql or anything else?
> 
> I know many connector/j uses big buffers and maybe they also have leak 
> problems. Derby instead have big caches, maybe it is a leak or maybe we 
> simply have to tune derby parameters (like we already did)
> 
> Stefano
> 
> Norman Maurer wrote:
> > Before applied the patch of Stefano or after ?
> > 
> > bye
> > Norman
> > 
> > Am Freitag, den 02.06.2006, 09:48 +0000 schrieb Bernd Fondermann (JIRA):
> >>     [ http://issues.apache.org/jira/browse/JAMES-512?page=comments#action_12414390 ] 
> >>
> >> Bernd Fondermann commented on JAMES-512:
> >> ----------------------------------------
> >>
> >> a db configuration runs into memory problems (Xmx=64m) after less than two hours, too.
> >>
> >> (this is a setup where 500 mails are created per minute, which is quite a load: 30 000 mails/hr!)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
> 
> !EXCUBATOR:1,4480195937021749511759!