[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory leaks?

From: Chris Vetter
Subject: Re: Memory leaks?
Date: Mon, 5 Sep 2005 15:13:44 +0200 (MEST)

On Mon, 5 Sep 2005 14:13:07, Nicola wrote:
> Ahm ... it would be a leak if every time you call NSLog, 50 objects get
> allocated and never released ... then the program would go on allocating
> more and more objects until eventually running out of memory. :-)
> But you called it just once.  The objects you see might be internal
> 'static' data used by the libraries, that are initialized at the first
> NSLog call.
> Try invoking NSLog again and again ... if the number of objects remains
> fixed to 50, then there is no leak and you can happily call as many NSLog
> as you want without running out of memory.  Obviously if every NSLog 
> invocations creates 50 new objects that are never released, then indeed 
> you have found a leak! ;-)

Yes, you're right and my using "leaks" probably was kind of a mis-nomer. I
played around some more and it looks like the values are kinda 'static' just
like Richard said they would.

I was just sort of baffled that a 'simple' NSLog would have such an impact
with respect to additional instances as my understanding of the autorelease
pool was that those instances would automagically get destroyed as well.
That is, all instances that are created between a pool-init and a
pool-release. Or is that only valid for instances within a separate thread?


Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]