Uploaded image for project: 'HttpComponents HttpCore'
  1. HttpComponents HttpCore
  2. HTTPCORE-485

Delete one unused buffer from SSLIOSession.

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.4.6
    • 4.4.7, 5.0-alpha4
    • HttpCore NIO
    • None
    • Patch

    Description

      Currently for each remote connection we make an SSLIOSession.

      Each SSLIOSession has 4 buffers:
      private final SSLBuffer inEncrypted;
      private final SSLBuffer outEncrypted;
      private final SSLBuffer inPlain;
      private final SSLBuffer outPlain;
      And each of these buffers occupies 16K (64K per remote connection).

      Our application uses NIO for long polling and we have 9000 idle long polling connections waiting for notifications.
      This makes 9000 * 64K = 576 000K (576MB).

      I checked the code and saw that the outPlain buffer is not used.
      I tested the code without it and everything worked fine.
      If we remove this buffer it will save 25% of the memory from the buffers used for the remote connections. In our case this is 144MB.

      Here is a proposed patch for SSLIOSession.java that removes the unused buffer.

      Regards,
      Todor Bonchev

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            TodorBonchev Todor Bonchev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment