Exceptions do happen and custom solutions can't help. In Nim there are no 
reliable ways to call "destructors" for heap objects, so hope only for 
finalizers and GC. However, the GC_fullCollect is misleading and does not 
always collect all the garbage (and not calling finalizers), for example when 
the realtime GC is activated. And there is no way to really force GC collect 
all garbage, if you need (I see no reason for such limiting).

The question is why GC_fullCollect sometimes don't collect all garbage on 
default configuration, maybe I inattentively studied the code. It set 
cycleThreshold to 0 and must allow to collect immediately.

[https://nim-lang.org/docs/gc.html](https://nim-lang.org/docs/gc.html) This 
page requires a warning that GC_fullCollect is sometimes useless and can do 
nothing. It is also worth noting that not everything that is definitely garbage 
is garbage for Nim.

Reply via email to