discuss-gnustep
[Top][All Lists]
Advanced

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

Re: question about GNUstep memmory consumption


From: Helge Hess
Subject: Re: question about GNUstep memmory consumption
Date: Fri, 03 Nov 2000 00:22:14 +0100

Fredo wrote:
> AutoReleasePools hold their objects with a simply linked-list of struct
> autorelease_array_list:
....
> Thus, the cost of each object hold by the pool is near from 4 bytes when
> the pool holds
> many objects.
> So we are far from the 84 bytes I see. Could this be related to the
> Objective-C runtime?

I can't see what the runtime should have to do with memory here.

So far I can calculate

  4 bytes RC
  4 bytes isa
  4 bytes value
 12 bytes

Additionally we have the pool-overhead of ~4 bytes

 16 bytes.

Still much less than 84 bytes. Hm.

Maybe it's related to the allocation scheme, eg if the pool increases
each pool chunk two times, it might be well possible that there is a
significant overhead, if your count is approaching the border. Maybe you
should try the increase for a quarter of the loop and see whether the
result is 25% of the size.
It would be also interesting what happens if you do *not* autorelease
the objects (that is [[NSNumber alloc] initWithInt:...]). I don't know
how it's done in gstep-base, but maybe there are additionally objects
created anyway.

Also it's to be found out how much overhead malloc() has. Malloc also
has to manage the allocated blocks and their location. It might be well
possible that malloc is not well optimized for small sized blocks.

Helge
-- 
SKYRIX Software Solutions - http://www.skyrix.com
Visit us at the Systems 2000 - LinuxPark - Munich



reply via email to

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