RE: Transfer Large binary data from client to server uses too much heap memory

From: kotesh <kotesh@xxx.com>
Date: Tue Apr 26 2005 - 20:07:08 PDT

Hi Albert,

         Try to clear and read...
             don't read complete file .
         byte [] tmpByteArray = new byte[1024];
             do like this...
        
              channel.position(chPos) // set the position to next 1024
              buf.clear(); // clear buffer for next fill
              numRead = channel.read(buf);

bye
-----Original Message-----
From: owner-hessian-interest@xxx.com
[mailto:owner-hessian-interest@xxx.com]On Behalf Of Toby Hede
Sent: Wednesday, April 27, 2005 9:34 AM
To: hessian-interest@xxx.com
Subject: Re: Transfer Large binary data from client to server uses too
much heap memory

I struggled with this issue a while ago, and the limit is Java itself.
Can't remember preceisely where, but the the runtime uses buffers in a
naive way that basically results in buffer memory being copied. Using
out of the box URLConnections the limit seems to be about 10mb. I had to
write my own socket-level code to get large files working (largest
transferred so far is 700mb CD ISO).

albert wrote:

>I wrote a java client to send a 95mb of file to a hessian servlet using
>the latest version of hessian.
>
>The problem i have is that the client needs at least 700mb of heap in
>order to send. Otherwise, i receive OutOfMemoryError.
>
>Please see the attached sources. Any hints are mostly welcome.
>
>Thanks a lot.
>
>
>
>

-- 
Toby Hede
Software Engineer
WebAlive Technologies Pty Ltd
Level 1, Innovation Building, Digital Harbour
1010 La Trobe Street
Docklands Melbourne VIC 3000
P: +61 3 9934 0888
F: +61 3 9934 0899
E: toby.hede@xxx.biz
W: www.webalive.biz
"Your Business, Your Web, Your Control."
 
This email (including all attachments) is intended solely for the named
addressee. It is confidential and may contain legally privileged
information. If you receive it in error, please let us know by reply
email, delete it from your system and destroy any copies. This email is
also subject to copyright. No part of it should be reproduced, adapted
or transmitted without the written consent of the copyright owner.
Emails may be interfered with, may contain computer viruses or other
defects and may not be successfully replicated on other systems. We give
no warranties in relation to these matters. If you have any doubts about
the authenticity of an email purportedly sent by us, please contact us
immediately.
Received on Tue 26 Apr 2005 20:07:08 -0700

This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:16:41 PDT