You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2007/06/05 21:44:26 UTC

[jira] Updated: (HTTPCORE-78) ExpandleBuffer uses direct byte buffers

     [ https://issues.apache.org/jira/browse/HTTPCORE-78?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCORE-78:
--------------------------------------

         Priority: Major  (was: Minor)
    Fix Version/s: 4.0-alpha5

Hi Steffen
A ByteBufferAllocator interface sounds like a good idea to me

Oleg

> ExpandleBuffer uses direct byte buffers
> ---------------------------------------
>
>                 Key: HTTPCORE-78
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-78
>             Project: HttpComponents Core
>          Issue Type: Improvement
>    Affects Versions: 4.0-alpha4
>            Reporter: Steffen Pingel
>             Fix For: 4.0-alpha5
>
>
> HttpCore allocates subtypes of ExpandleBuffer per connection for buffering requests and responses. ExpandleBuffer creates a buffer using ByteBuffer.allocateDirect() which is initialized to a certain size but may be resized as needed requiring the garbage collector to discard the old buffer. 
> According to the documentation for ByteBuffer, direct buffers are recommended for "large, long-lived buffers that are subject to the underlying system's native I/O operations". It seems that these buffers are rather short-lived and ByteBuffer.allocate() might be a better choice for allocation. 
> Another option would be to pass a factory for allocating and releasing buffers which could reduce the number of allocations by reusing buffers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org