Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-649

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.3.0
    • Component/s: POP3Server
    • Labels:
      None
    • Environment:
      Operating system: Windows XP SP2

      Description

      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

        Activity

        Hide
        norman Norman Maurer added a comment -

        Can you please tell us what for a repository you use ? file, jdbc,dbmail ?

        Show
        norman Norman Maurer added a comment - Can you please tell us what for a repository you use ? file, jdbc,dbmail ?
        Hide
        bago Stefano Bagnara added a comment -

        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)
          Unknown macro: { 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();
          }
          ------

        Show
        bago Stefano Bagnara added a comment - 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) Unknown macro: { 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(); } ------
        Hide
        norman Norman Maurer added a comment -

        seems to be fixed.

        Show
        norman Norman Maurer added a comment - seems to be fixed.
        Hide
        bago Stefano Bagnara added a comment -

        being backported

        Show
        bago Stefano Bagnara added a comment - being backported
        Hide
        norman Norman Maurer added a comment -

        Change fix version

        Show
        norman Norman Maurer added a comment - Change fix version
        Hide
        danny@apache.org Danny Angus added a comment -

        Closing issue fixed in released version.

        Show
        danny@apache.org Danny Angus added a comment - Closing issue fixed in released version.

          People

          • Assignee:
            norman Norman Maurer
            Reporter:
            maximeloridan maximeloridan
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development