I just thought of something, before looking at the code you've provided,
that might matter.

Per http://docs.python.org/library/stringio.html the memory buffer is not
freed until you call the .close() method. So, what you might need to do is
store the file handle in the request variable, and then call .close() in the
__after__ method. Otherwise, you could use the .get() to retrieve the value,
and then call .close() in the main method itself.

That might take care of it for you entirely.

On Mon, Apr 25, 2011 at 11:41 AM, Adrian <[email protected]> wrote:

> Sorry for the wait, this weekend got a little crazy.. Here is a tar/
> zipped Turbogears project I created: http://a-p-w.com/tarfile-test.tar.gz
>
> I did the simplest possible thing "paster quickstart" and followed the
> directions. Then I added a function to 'root.py' called 'returnImages'
> that just tars up 3 files (that I included in the tarball) and returns
> the bytestream for the tar file. I just tried this on my machine - I
> downloaded the file several times and watched the memory usage climb
> accordingly. It's set up to run on localhost:8080, so the page to go
> to is http://localhost:8080/returnImages
>
> Thanks!
> Adrian
>
> On Apr 23, 5:07 pm, "Diez B. Roggisch" <[email protected]> wrote:
> > Yep, better though to place it somewhere to download. Or create a
> github/bitbucket repo.
> >
> > Diez
> >
> > Am 23.04.2011 um 18:40 schrieb Adrian <[email protected]>:
> >
> >
> >
> > > Sure, so you want me to make a new project with a single controller
> > > that returns a tarfile like this? Do you want me to zip it up and send
> > > it to you guys?
> >
> > > On Apr 23, 6:03 am, "Diez B. Roggisch" <[email protected]> wrote:
> > >> On Apr 23, 2011, at 5:46 AM, Adrian wrote:
> >
> > >>> Repeated invocation is accumulating memory -- each time I request a
> > >>> new tar-file the memory usage increases by about the size of the
> file,
> > >>> a little more actually.
> >
> > >> Hm. As nothing you apparently do strikes me as odd, I'd like to ask
> you to create a very simple TG21-app that reproduces the problem, so we can
> debug.
> >
> > >> Diez
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups "TurboGears" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> [email protected].
> > > For more options, visit this group athttp://
> groups.google.com/group/turbogears?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.
>
>


-- 
Michael J. Pedersen
My IM IDs: Jabber/[email protected], ICQ/103345809, AIM/pedermj022171
          Yahoo/pedermj2002, MSN/[email protected]
My LinkedIn Profile: http://www.linkedin.com/in/michaeljpedersen

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to