Hi,

nice to hear, you like Tntnet.

You are right. The request is collected completely into memory. And for large 
files you need a lot of memory. This is not that easy to change. But also not 
impossible. I thought about it.

One problem is, that the application have no chance to make a decision, how to 
handle the request before the request is complete. And I don't want to write 
each request body to the file system. A possible solution is to stream 
request bodys to files, which are larger than a configurable size.

The multipart-class needs to be changed to return a pimpl iterator, which has 
either a implementation to iterate through a file or through memory. This 
would make the system quite transparent. The application does not need to 
care, where to find the data. As long as the application uses iterators to 
fetch the body, the data doesn't never need to be loaded into memory. 
tnt::Part::getBody() returns a std::string. This may create a string in 
memory.

Currently the iterator in tnt::Multipart are typedefs to 
std::string::const_iterator. This is a random access iterator. The 
pimpl-suggestion would reduce it to a forward iterator. I don't see any sense 
to make a random access iterator to a file.

This might be a nice addition to tntnet. But I have to think about it, if it 
doable.

Tommi

On Monday 07 April 2008 12:02:41 FrameBuster wrote:
> Hi, all
>
> First i want to Say is "TNTNET IS REALLY COLOSSAL"
>
>
> Current the Upload behavior from TNTNET is to hold all uploaded data in
> Memory. But when i want to Upload BIG Datafiles, the server is under heavy
> load, because it is swapping the Memory to the Disc.
>
> It is possible to change this manner to write a temporary File to Disc that
> i can access in the WebApp?
>
>
> Kind Regards
> Jan

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to