[ 
https://issues.apache.org/jira/browse/HTTPCORE-485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16142722#comment-16142722
 ] 

ASF subversion and git services commented on HTTPCORE-485:
----------------------------------------------------------

Commit 271c053d4b6e8b827e29715712d7faf0f975dcbf in httpcomponents-core's branch 
refs/heads/4.4.x from [~TodorBonchev]
[ https://git-wip-us.apache.org/repos/asf?p=httpcomponents-core.git;h=271c053 ]

HTTPCORE-485: Remove one buffer from SSLIOSession.java because it is not used.

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).
If an application uses NIO for long polling and there are (for example) 9000 
idle long polling connections waiting for notifications.
This makes 9000 * 64K = 576 000K (576MB).
As outPlain buffer is not used if we remove it this will save 25% of the memory 
from the buffers used for the remote connections. In the example case this is 
144MB.


> Delete one unused buffer from SSLIOSession.
> -------------------------------------------
>
>                 Key: HTTPCORE-485
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-485
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore NIO
>    Affects Versions: 4.4.6
>            Reporter: Todor Bonchev
>         Attachments: SSLIOSession.java.patch
>
>
> 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



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to