Got the following with -s
option. Duh, it requires normal termination, not killing via signal, but my program normally never terminates.
84,624,352,560 bytes allocated in the heap
7,374,360 bytes copied during GC
14,800,208 bytes maximum residency (20 sample(s))
129,656 bytes maximum slop
49 MiB total memory in use (0 MB lost due to fragmentation)
14MB maximum residency, while memory consumption was increasing to near 200MB.
Guess it is likely the FFI side, then.
eventlog2html
also confirms that (ghc) heap size remains at constant 42MB. Far higher than maximum residency (or live bytes lying at 14MB) but eh. At least no leak there, this one is constant. (OS Memory was exceeding 200MB at this point)
Trying C debugging.
valgrind
so far does not give any specific signals. Only 38MB is “possibly” lost on exit. (Think it might be tripped on that haskell runtime is unusual)
Even scarier, memory usage with presence of valgrind is stable.
++
Now I am in horror, somehow at some point it stopped taking more memory!
I don’t know what is happening, perhaps -optc-g
is lessening the memory leak?
Hmmm.
++
Just found that opening VSCode is causing (not my code) to emit icon not found errors, causing strange phenomenon of memory explosion! I don’t know how “icon not found” could cause such problems.