Subject: Re: leaking iconv handles, wv return type
From: Sam TH (sam@uchicago.edu)
Date: Wed Nov 15 2000 - 08:34:20 CST
On Wed, Nov 15, 2000 at 05:31:06PM +0400, Vlad Harchev wrote:
> On Wed, 15 Nov 2000, Thomas Fletcher wrote:
> 
> > On Wed, 15 Nov 2000, Vlad Harchev wrote:
> > 
> > > On Tue, 14 Nov 2000, Thomas Briggs wrote:
> > > 
> > > > >  XAP_EncodingManager is assumed to be created no more than 3 times. So I
> > > > > didn't care about leaking iconv descriptors - they don't take a lot of
> > > > memory
> > > > > (no more than 100bytes each). I don't recommend spending time on bothering
> > > > to
> > > > > close those descriptors.
> > > > 
> > > >    I would normally refrain but such obvious flame bait, but I have to ask:
> > > > you can't be serious, can you?
> > > 
> > >  By serious, you mean "don't joke"? If I don't append smiley, then I don't
> > > joke.  If you mean "be more responsible" - I am since I know that not
> > > releasing iconv handles won't make any harm except of additional 500 bytes of
> > > memory not returned to memory heap.
> > 
> > Or under an embedded system where the number of system
> > fd's is potentially limited, running out of file descriptors.
> > In a long running program (which AbiWord could potentially
> > be) then there is no reason that you shouldn't be cleaning
> > up after yourself.  Compared to the time that we spend doing
> > other operations, the work of free() and close() are noise
> > and we should do everything we can to prevent the leak of
> > _any_ resource (be it memory or file descriptors).  Addressing
> > this issue now will mean that someone won't have to deal with
> > it later when/if it becomes a problem.
> 
>  As I said, initialize is called only 3 times per AW session. So it doesn't
> matter how long you run AW - the amount of leaked memory will be the same.
> And AW is not supposed to run in embedded environment.
AbiWord is *PORTABLE*  That means that it runs everywhere we can
possible get it to compile.  Someday, you may write up your
shopping list on you intelligent fridge with AbiWord.  
>  
> > Vlad, you are obviously a very capable developer ... why 
> > are you against taking the 10 minutes that it would probably
> > take to properly address this issue?
> 
>  I don't want to bother with this burocratical issue and force future guys who
> will extend XAP_EncodingManager bother studying and then updating
> that additional code for sake of 500 leaked bytes that leak completely under 
> our control. I.e. don't turn freeing them into a policy.
No.
Freeing allocated memory *is* policy.  And that policy is *not* 
going to change.  
Vlad, this attitude isn't ok.  Even though this is a small thing, we 
have built a quality system by paying attention to the small things.
           
        sam th		     
        sam@uchicago.edu
        http://www.abisource.com/~sam/
        GnuPG Key:  
        http://www.abisource.com/~sam/key
This archive was generated by hypermail 2b25 : Wed Nov 15 2000 - 08:34:21 CST