On Wednesday 16 April 2003 10:02 am, Johan Carlsson [EasyPublisher] wrote:
At 09:46 2003-04-16 -0400, Casey Duncan said:
[snip]
This could be useful for other stuff as well (except streaming large object, which should never be saved in the ZODB by the way, be cause it bloats the memory when the object is loaded. It should be stream from a file, and not by reading the entire file as most file system object product I reviewed does including LocalFS which I have made a patch for).
Just FYI: Zope file objects are not completely loaded into memory when they are accessed (and served). They are divided into 64K chunks in the ZODB (where each chunk is an individual record). Files > 64k are streamed using response.write() when they are served. Files smaller than that are served all at once. -Casey
But isn't it un-pickled into memory?
The file is divided into 64K chunks, each of which is pickled. Each chunk is unpickled separately and then discarded.
I did some work on this last year (for 2.4 or something) and in my tests Zope hang quite effectively when using regular File Objects. But streaming from a file on the file system did work every time.
If that's still true, then I would regard it as a bug.
I tried this on a 200MB video clip and the client was Microsoft MediaPlayer.
Have anything change in resent Zope releases?
It has been this way for a long time. -Casey