Hey all!
I have a long running server like program that memory leak in a condition related to DB access. I normally use -prof
, set SCC
at the interesting call sites and then launch the program with ./program +RTS -l -hc --RTS
to generate a eventlog to be processed by eventlog2html
.
This works fine small short running programs. On my case, this long running server has an specific network specific condition that trigger this leak. We notice it by checking the RSS on htop not being released after 15 major collections. The server still works though. The eventlog file generated is huge, in the order of 25GB and eventlog2html
cannot process it without the OOM triggering. In fact I am not event interested in most of the data, I only want to collect data on the eventlog after I notice the condition.
I was think on instrumenting a signal handler for SIGUSR1 and then enable collection programmatically. I don’t see any module on base under the GHC. hierarchy to do so nor blogposts about it. I did noticed about profiling eras
, is this the best approach to do this with the current setup?