Get largest heap object at runtime? ...tracking the leak

Andres Clari andres at steelcode.net
Mon Jan 22 16:37:19 UTC 2018


On Monday, 22 January 2018 at 15:56:53 UTC, thedeemon wrote:
> On Monday, 22 January 2018 at 06:48:00 UTC, Andres Clari wrote:
>> Not sure why "spawn" would leak like that tho. I would assume 
>> that once the thread exits, it would get destroyed and it's 
>> resources reclaimed, specially when I have calls to 
>> "GC.collect and GC.minimize".
>
> All threads withing a process share the same heap, so whatever 
> one thread allocated in that heap is not freed or reclaimed 
> automatically when thread dies, it stays in the heap.

Well the destructor of some Json objects and strings should be 
called when the thread exits tho. Why wouldn’t the GC take care 
of this?


More information about the Digitalmars-d-learn mailing list