On 16/01/2007, at 6:54 PM, [EMAIL PROTECTED] wrote:

I have this, very simple input filter

def inputfilter(filter):
    if filter.req.method != 'POST':
        filter.pass_on()
        return
    filter.req.log_error('first read')
    s = filter.read()
    while s:
        filter.req.log_error('writing (%s)' % len(s))
        filter.write(s)
        #filter.flush()
        s = filter.read()
    if s is None:
        filter.req.log_error('closing')
        filter.close()

I would like to use an input filter  for uploading large files.
I would expect that after each writing/reading, filter releases memory.But instead memory increases during reading/writing and no memory is released after each reading/writing. Is it a common feature that the filter during reading/writing does NOT release memory and
memory increases until the whole file is uploaded?
Or is my presumption correct that the memory should be released during each
reading/writing in the filter?
Thank you for help and reply.

Since I don't recollect you saying what version of mod_python you are
using, I would suggest you upgrade to mod_python 3.3.0b if you aren't
using it already. Once you have confirmed that you still have the problem
with that version let us know. Also state which versions of Apache and
Python you are using at the same time.

For 3.3.0b see:

  http://httpd.apache.org/modules/python-download.cgi
  http://nicolas.lehuen.com/download/mod_python/

The latter has Windows binaries for various Apache/Python combos.

Graham

Reply via email to