Issue Details (XML | Word | Printable)

Key: JAMES-649
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Norman Maurer
Reporter: maximeloridan
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JAMES Server

error "OutOfMemoryError: JAVA HEAP SPACE" in connections log file when doing a POP TOP for 4000 messages

Created: 04/Oct/06 10:22 AM   Updated: 21/Nov/07 08:31 AM
Return to search
Component/s: POP3Server
Affects Version/s: 2.3.0
Fix Version/s: 2.3.0

Time Tracking:
Not Specified

Environment: Operating system: Windows XP SP2

Resolution Date: 05/Oct/06 07:32 PM


 Description  « Hide
First I reproduced this bug on 2.3.0rc3 and 2.3.0rc4 and it's easy to reproduce it every time.

To reproduce it:
1/ Start James and create a user "userTest".
2/ Send 5000 messages to "userTest"
3/ Do a POP TOP to retrieve all the headers of messages from "userTest". To do this, use a software as Outlook. Configure it to retrieve mail from "userTest" and then click to retrieve the headers ONLY. DO NOT retrieve all the content of the message, otherwise you will do a POP RETR which is not a POP TOP! (Nota: the POP RETR is actually working, and I know that most of the time, people do retrieve all the content of the mail and not only the headers.. But it should work)

Finally you just have to wait the crash of JAMES. It will appear around the 3500 message...
The error is written in the log folder in the file connections. The error is OutOfMemoryError: JAVA HEAP SPACE

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Norman Maurer made changes - 04/Oct/06 10:42 AM
Field Original Value New Value
Assignee Norman Maurer [ norman ]
Repository Revision Date User Message
ASF #452895 Wed Oct 04 14:29:23 UTC 2006 norman Junit test for JAMES-649.
Files Changed
MODIFY /james/server/trunk/src/test/org/apache/james/pop3server/POP3ServerTest.java
MODIFY /james/server/trunk/src/test/org/apache/james/test/mock/javaxmail/MockMimeMessage.java

Norman Maurer added a comment - 04/Oct/06 03:16 PM
Can you please tell us what for a repository you use ? file, jdbc,dbmail ?

Stefano Bagnara added a comment - 04/Oct/06 03:54 PM
Are you able to change code and try again?
I would like to know what is the result if you add this method to MimeMessageWrapper:
----
    /**
     * @see javax.mail.internet.MimeMessage#getRawInputStream()
     */
    public InputStream getRawInputStream() throws MessagingException {
        if (!messageParsed && !isModified() && source != null) {
            InputStream is;
            try {
                is = source.getInputStream();
                // skip the headers.
                new MailHeaders(is);
                return is;
            } catch (IOException e) {
                throw new MessagingException("Unable to read the stream: " + e.getMessage(), e);
            }
        } else return super.getRawInputStream();
    }
------

Repository Revision Date User Message
ASF #452969 Wed Oct 04 18:36:41 UTC 2006 bago Added an optimized getRawInputStream to MimeMessageWrapper: if we have an unchanged message we read the headers from the original inputstream (to skip them) and then return it to the caller (Attempt to fix JAMES-649)
Files Changed
MODIFY /james/server/trunk/src/java/org/apache/james/core/MimeMessageWrapper.java

Norman Maurer added a comment - 05/Oct/06 07:32 PM
seems to be fixed.

Norman Maurer made changes - 05/Oct/06 07:32 PM
Resolution Fixed [ 1 ]
Fix Version/s Trunk [ 10427 ]
Status Open [ 1 ] Resolved [ 5 ]
Repository Revision Date User Message
ASF #454173 Sun Oct 08 17:13:19 UTC 2006 norman Backport JAMES-649
Files Changed
MODIFY /james/server/branches/v2.3/src/java/org/apache/james/core/MimeMessageWrapper.java

Stefano Bagnara added a comment - 08/Oct/06 05:13 PM
being backported

Stefano Bagnara made changes - 08/Oct/06 05:13 PM
Fix Version/s 2.3.0rc5 [ 12312049 ]
Fix Version/s Trunk [ 10427 ]
Norman Maurer added a comment - 08/Oct/06 05:13 PM
Change fix version

Danny Angus added a comment - 21/Nov/07 08:31 AM
Closing issue fixed in released version.

Danny Angus made changes - 21/Nov/07 08:31 AM
Status Resolved [ 5 ] Closed [ 6 ]