@ML >So regarding the GC, does it mean, that even with --d:malloc the allocator 
will hold that memory until whole process quits?

If I remember correctly, `-d:useMalloc` only works for ARC/ORC, so if you're 
not using those, it has no effect. I've dealt with the same issue, thinking the 
program was leaking memory everywhere when really it was just keeping it for 
itself. If you're ever doing debugging with Valgrind or similar, using 
`-d:useMalloc` can help, but in general it does also let you return memory to 
the OS. I tend to compile with it because I don't like Nim sucking up memory 
and freeing it at weird times.

If you want a deterministic memory management strategy and can handle yourself 
and not create any cycles, use ARC. You'll have a much easier time reasoning 
about memory management that way.

Reply via email to