Discussion:
Java Heap memory problem
Azwidohwi Swethane
2009-03-17 20:48:24 UTC
Permalink
Hi All,
I have a Java mail listener that picks up email from an IMAP server about
10 emails at a go. The listener then invoke an EJB method sending each
message for processing. However, every time i deploy the application my heap
memory keep rising until server crashes. I tried profiling the application
but i can't pin point the problem so far.

Any advice would be welcome if you have experience with processing high
volume emails. Its my first time using java mail for high volume message
processing.

David

===========================================================================
To unsubscribe, send email to ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".
Bill Shannon
2009-03-18 06:21:55 UTC
Permalink
Post by Azwidohwi Swethane
Hi All,
I have a Java mail listener that picks up email from an IMAP server
about 10 emails at a go. The listener then invoke an EJB method sending
each message for processing. However, every time i deploy the
application my heap memory keep rising until server crashes. I
tried profiling the application but i can't pin point the problem so far.
Any advice would be welcome if you have experience with processing high
volume emails. Its my first time using java mail for high volume message
processing.
You've heard of the bisection method of debugging, right?

Eliminate half of your program and see what difference it makes.
Then eliminate the other half and see what difference it makes.

Instead of actually reading email, generate fake data and process it.

Instead of actually processing the data with an EJB, just throw the data
away.

See if either half causes your server memory to increase.

Repeat as necessary to narrow down the source of the problem.

===========================================================================
To unsubscribe, send email to ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".
Loading...