In c it depends which allocator you use. Most people don't use the default
malloc because it's slow. They have a layer above it which uses it for big
chunks while using internal thing for small chunks.
For really big chunks Nim will use the standard is malloc and they will free
back. This does
No, the memory will be released to the OS.
The GC does release memory under certain
[circumstances](https://github.com/nim-lang/Nim/blob/b07694cd90ab7c6eb4660971ddb818b461d4eed8/lib/system/alloc.nim#L861).
The code is rather hard to follow though, and I'm not sure _when_ exactly
would the GC release memory back to OS. But if you allocate
Is this true with manual memory management as well, or just the built-in memory
management and GC?
Like, if you were to, say, manually allocate space to load and copy/resize a 20
megapixel photo, will the app continue to occupy 200 MB of RAM even after the
memory is released by the app?
Thank you for your answer. I think that's because Nim does not free memory to
OS. It's still ok for me that it's not memory leak
Nim does not free memory back to the OS. So it's memory will always rise, its
internal free pool will be free but the OS will not see it that way. If you
allocated 12GB of stuff then free it. OS will report it using 12GB... while
your nim program knows it has 12GB in its "free buffer".
[https:/
Does it ever rise above 12mb? To be honest, 12mb isn't bad and I don't think
the GC will aggressively free that. Maybe it's too much for you?