Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 21376 invoked from network); 22 Feb 2008 15:11:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Feb 2008 15:11:53 -0000 Received: (qmail 84092 invoked by uid 500); 22 Feb 2008 15:11:48 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 83898 invoked by uid 500); 22 Feb 2008 15:11:47 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 83889 invoked by uid 99); 22 Feb 2008 15:11:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 07:11:47 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [217.150.250.44] (HELO ok2consulting.nine.ch) (217.150.250.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 15:11:13 +0000 Received: from d213-101-185-2.cust.tele2.ch ([213.101.185.2] helo=[192.168.25.127]) by ok2consulting.nine.ch with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.50) id 1JSZYV-0000Mp-25 for dev@hc.apache.org; Fri, 22 Feb 2008 16:11:19 +0100 Subject: Re: svn commit: r630209 From: Oleg Kalnichevski To: HttpComponents Project In-Reply-To: <19196d860802220702m6912018ar689d46bcbc7a6c6f@mail.gmail.com> References: <20080222135755.25CE11A9838@eris.apache.org> <25aac9fc0802220639w5586b484ua1d495dd9163b301@mail.gmail.com> <19196d860802220702m6912018ar689d46bcbc7a6c6f@mail.gmail.com> Content-Type: text/plain Date: Fri, 22 Feb 2008 16:10:26 +0100 Message-Id: <1203693026.5669.4.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Fri, 2008-02-22 at 10:02 -0500, Sam Berlin wrote: > I don't think increasing the amount transferred actually increases the > memory used -- the data's transferred directly from disk to socket, > with what should be no temporary buffer in-between. The '100' value > left there (as opposed to MAX_VALUE) was a holdover from while I was > testing to make sure chunked encoding worked (and I forgot to fully > revert the changes). > > Sam > I agree. As there is no intermediate memory buffer involved, I personally do not see a single legitimate reason for using any other value but maximum possible. In case one really wants to transfer data in smaller chunks, one can always provide a custom ProducingNHttpEntity impl. Oleg > On Fri, Feb 22, 2008 at 9:39 AM, sebb wrote: > > On 22/02/2008, olegk@apache.org wrote: > > > Author: olegk > > > Date: Fri Feb 22 05:57:51 2008 > > > New Revision: 630209 > > > > > > URL: http://svn.apache.org/viewvc?rev=630209&view=rev > > > Log: > > > HTTPCORE-148: Transfer as many bytes as possible at a time. This fix improves performance significantly (up to 5x) > > > > > > > What if the user wants to limit the memory that is used? > > > > Is there a way to override this? If not, perhaps there should be? > > > > > Modified: > > > httpcomponents/httpcore/branches/limewire_contrib/module-nio/src/main/java/org/apache/http/nio/entity/NFileEntity.java > > > > > > Modified: httpcomponents/httpcore/branches/limewire_contrib/module-nio/src/main/java/org/apache/http/nio/entity/NFileEntity.java > > > URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/limewire_contrib/module-nio/src/main/java/org/apache/http/nio/entity/NFileEntity.java?rev=630209&r1=630208&r2=630209&view=diff > > > ============================================================================== > > > --- httpcomponents/httpcore/branches/limewire_contrib/module-nio/src/main/java/org/apache/http/nio/entity/NFileEntity.java (original) > > > +++ httpcomponents/httpcore/branches/limewire_contrib/module-nio/src/main/java/org/apache/http/nio/entity/NFileEntity.java Fri Feb 22 05:57:51 2008 > > > @@ -95,9 +95,11 @@ > > > > > > long transferred; > > > if(useFileChannels && encoder instanceof FileContentEncoder) { > > > - transferred = ((FileContentEncoder)encoder).transfer(fileChannel, idx, 100); > > > + transferred = ((FileContentEncoder)encoder) > > > + .transfer(fileChannel, idx, Long.MAX_VALUE); > > > } else { > > > - transferred = fileChannel.transferTo(idx, Long.MAX_VALUE, new ContentEncoderChannel(encoder)); > > > + transferred = fileChannel. > > > + transferTo(idx, Long.MAX_VALUE, new ContentEncoderChannel(encoder)); > > > } > > > > > > if(transferred > 0) > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org > > For additional commands, e-mail: dev-help@hc.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org > For additional commands, e-mail: dev-help@hc.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org