[Top][All Lists]

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

Re: question about GNUstep memmory consumption

From: Fredo
Subject: Re: question about GNUstep memmory consumption
Date: Thu, 02 Nov 2000 00:03:16 +0000

Manuel Guesdon a écrit :
> On Thu, 02 Nov 2000 19:27:18 +0100 Helge wrote:
>  >| I'm not sure how gstep-base maintains extra-retain-counts, but they
>  >| might also add overhead (eg if stored in an external hashtable) here.
> Most code concerning this is located in NSObject.m.
> ExtraRefCount seems to be located at obj[-1] (i.e. at object address - size 
> of int*). So extra data are allocated for any object. It may depends on 
> garbage collection options,...

AutoReleasePools hold their objects with a simply linked-list of struct

struct autorelease_array_list
  struct autorelease_array_list *next;
  unsigned size;
  unsigned count;
  id objects[0];

The "objects" member has an initial size of 32 elements and each struct
autorelease_array_list added to the pool gets an array which is twice
the size of the
previous (64, 128, ... ).
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?

Regards, Frederic

PS: I use GNUstep with default options, ie. no garbage collector

reply via email to

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