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
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
Yes I forgot, of course I compiled always with
nim c --gc:arc -d:useMalloc myproc.nim
I guess I can not use https://github.com/KDE/heaptrack as I have not installed Qt and KDE, and I do not really intend too. Gnome is ugly still, but I don't think that KDE is really better. (I used KDE for some years when I started with Linux decades ago :-)