This is exactly the kind of thing _gc:arc_ is designed to fix.
    
    
    -gc:arc -d:useMalloc c yourProgram.nim
    
    Run

GC arc is deterministic (meaning memory will be freed immediately after Nim 
thinks it's done with it, i.e. C++ destructors) and useMalloc will force nim to 
use the system malloc / free, so memory will be directly used and returned to 
the operating system, without the Nim runtime holding onto the memory. 

Reply via email to