[prev in list] [next in list] [prev in thread] [next in thread]
List: sylpheed
Subject: [sylpheed:24702] Re: [patch] saving some memory when sending mail
From: <Dirk-Jan.Binnema () nokia ! com>
Date: 2005-04-19 7:42:50
Message-ID: D8ECD0B6B0695144A6C2C000997D6BF46D20BB () esebe105 ! NOE ! Nokia ! com
[Download RAW message or body]
Hi Hiroyuki,
> -----Original Message-----
> From: ext Hiroyuki Yamamoto [mailto:hiro-y@kcn.ne.jp]
> Sent: 19 April, 2005 09:19
> To: sylpheed@good-day.net
> Subject: [sylpheed:24700] Re: [patch] saving some memory when sending
> mail
> On Fri, 15 Apr 2005 13:10:08 +0300
> <Dirk-Jan.Binnema@nokia.com> wrote:
>
> > > > I noticed that Sylpheed takes a lot of memory when sending mail.
> > > > To test this, I tried to send a 50Mb file, and Sylpheed memory
> > > > usage increased about 200Mb(!). That can be fixed by not reading
> > > > the whole message (incl. attachments) in memory.
> > > >
> > > > However, did not do that yet, but instead I wrote a
> little patch
> > > > which takes out one of the copies made - now, in my test case,
> > > > we 'only' need about 120Mb.
> > >
> > > Good idea, but it seems that the memory will not be freed if the
> > > session is aborted before calling session_send_data().
> >
> > oh yes - you are the expert :-) how about this patch then?
>
> The patch still have the possibility of Session::write_buf not freed
> (which is also used for sending one-line messages).
>
> So I've modified session.[ch] to use separate buffer for a data to be
> sent (see 'svn di -r 220:221' at the trunk).
Hmmm... I assumed that smtp_destroy will always be called at the end?
Anyway, I made a patch that uses the rfc822 data as tempfile instead of
g_malloc in the sending path, and now sending an email requires no allocations
at all, and I can comfortably send 50Mb files.
But I will review it a bit more; obviously there is some things in the framework
I don't fully understand yet, and causing these embarrasing possible leaks.
I will talk to Seiya as well.
Thanks for your help.
Dirk.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic