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

Robbie Gemmell commented on PROTON-597:
---------------------------------------

I rebased the above patch to the current trunk (minor merge conflict), and made 
some subsequent changes to remove the intermediate scratch buffer, and make the 
release of the buffers only occur above a particular threshold (currently 
defaulted, and changed via system property).

The rebased original change is here:
https://github.com/gemmellr/qpid-proton/commit/5dbf8e9dafae0c1f26d3f7aae09d27845b311063
The removal of the scratch buffer is here:
https://github.com/gemmellr/qpid-proton/commit/da763fdaf295a888b5b8c398ce1032d2ca9d6796
The change to make the release occur above a threshold is here:
https://github.com/gemmellr/qpid-proton/commit/1a5f5db4badf82254d350cb21dbf89873bf2c22e

> Improve the memory footprint of TrasportImpl
> --------------------------------------------
>
>                 Key: PROTON-597
>                 URL: https://issues.apache.org/jira/browse/PROTON-597
>             Project: Qpid Proton
>          Issue Type: Improvement
>          Components: proton-j
>    Affects Versions: 0.7
>            Reporter: Marcel Meulemans
>            Assignee: Robbie Gemmell
>            Priority: Minor
>         Attachments: 24ac15802a67d2eff0257e79827c3a09879ce0a4.patch
>
>
> The memory footprint of the TrasportImpl can be quite high when using large 
> maxFrameSizes (for example 1MB). In the TrasportImpl of proton-j there are 
> two classes TrasportOutputAdaptor and FrameParser (TrasportImpl has a member 
> of both) that hold a ByteBuffer of maxFrameSize throughout their lifetime. In 
> the case of the 1MB frame size that means that each transport has a fairly 
> high memory footprint (2MB) considering that this memory is hardly ever used, 
> i.e. only when there is a frame to transfer in/out and in most cases the 
> frame will not be maxFrameSize. Because there is a Transport for every 
> connection the memory usage can become quite high when dealing with many 
> connections with large maxFrameSize, e.g. 2GB for only 1000 connections.
> An proof of concept implementation for reducing the memory footprint by only 
> allocating the buffers when needed can be found here:
> https://github.com/marcelmeulemans/qpid-proton/
> See also the short mailinglist disscusion here:
> http://qpid.2158936.n2.nabble.com/High-memory-footprint-of-proton-j-in-ActiveMQ-td7608977.html



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to