directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject Re: [MINA] OutOfMemoryError on streaming large files
Date Tue, 13 Dec 2005 05:09:51 GMT
Hi Johannes,

2005/12/12, Johannes Zillmann <jz8_blue@yahoo.de>:
>
> i'm sending a 83 MB file over net with help of mina.
> The receiving hanlder is a StreamIoHandler, a own
> thread reads from IoSessionInputStream and write the
> bytes to file.
> After writing 65MB successfully to disk i've got
> following exceptions:  Have sombody a hint for me ?
> I'm using the latest 0.9 head.


Why don't you wait for the WriteFuture you get when you write data?  Like
this...


for( int i = 0; i < nChunks; i ++ ) {
    session.write(chunks[i]).join();
}

This will prevent from too much memory being allocated in short time.

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Mime
View raw message