[Glass] Temporary object memory and C heap

bruno buzzi brassesco smalltalk at adinet.com.uy
Mon Oct 3 13:26:17 PDT 2022


Norm,
Thank you for the answer, it totally make sense to me now that Gem 
memory use anonymous mapping to allocate Gem TOC.

regards, bruno

On 3/10/2022 15:35, Norm Green via Glass wrote:
> Hi Bruno,
>
> Please see comments below.
>
> Norm
>
>
> On 10/3/22 7:33 AM, bruno buzzi brassesco via Glass wrote:
>> Hi,
>>
>> And I have doubt about GEM temporary object memory from a C point of 
>> view (each Gem is a C program).
>> Is the Gem "temporary object memory" allocated in the C heap ? (I 
>> think yes but ...)
> No, gem TOC memory is allocated using mmap(2), which is neither C heap 
> nor stack. On Linux and platforms that support the mmap flag 
> MAP_NORESERVE, the address space for TOC memory is reserved at startup 
> time but is not actually allocated until it's needed.
>>
>> The confusion come from that from Prg manual "GsBitmaps do not used 
>> temporary object memory", but they use "C Heap memory".
> That means that very large GsBitmaps will not cause OutOfMemory errors 
> because their structures are not created in the TOC but rather are 
> allocated on the C heap using malloc().
>>
>> Maybe the manual differentiate  GEM temporary object memory and C 
>> Heap to make a difference between exclusively Smalltalk memory and 
>> non Smalltalk memory (but both are C Heap memory).
> Normal objects live in object memory spaces (new space, old space, 
> etc) but GsBitmaps are special and live in C heap memory.
>>
>> regards bruno
>>
>> PS: anyone from GemTalk is going to FAST next month ?
> Yes, I believe James Foster is going to FAST.
>>
>> _______________________________________________
>> Glass mailing list
>> Glass at lists.gemtalksystems.com
>> https://lists.gemtalksystems.com/mailman/listinfo/glass
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> https://lists.gemtalksystems.com/mailman/listinfo/glass


More information about the Glass mailing list