hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HTTPCORE-78) ExpandableBuffer uses direct byte buffers
Date Fri, 08 Jun 2007 19:32:26 GMT

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

Oleg Kalnichevski resolved HTTPCORE-78.
---------------------------------------

    Resolution: Fixed

Patch checked in. Many thanks, Steffen

> BTW, is it possible to limit the maximum request URI length and header/request length?
I am concerned that overly 
> large requests would cause the buffers to resized until no more memory is available or
the maximum buffer size of 
> Interger.MAX_VALUE is reached. 

'http.connection.max-line-length' and 'http.connection.max-header-count' parameters are already
being enforced in HttpCore base (blocking) module. These checks still need to be implemented
in HttpCore NIO.

Oleg

> ExpandableBuffer 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
>
>         Attachments: httpcore-bytebuffer-allocator.patch, httpcore-bytebuffer-allocator.patch,
httpcore-heap-allocator.patch
>
>
> 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


Mime
View raw message