Often use of /usr/bin/time -v is recommended for checking for the maximum
memory consumption of a program. That information is given in
Maximum resident set size (kbytes): 64392
Run
Yesterday I spent a few hours wondering why it was showing leaks fine for C
test programs, but for a similar Nim program which generated a leak by intent
by creating a lot of cairo image surfaces the maximum memory consumption never
got larger that approx 100 MB, while for the C example we got GB leaked fast.
My guess is that it may be related to the fact that Nim uses dlopen to access C
libs, and so it may be not obvious which allocated memory belongs to the Nim
program?
Well valgrind seems to show the real Nim leaks, but as
possibly lost: 536,918,180 bytes in 88 blocks
Run