Thanks for your response.
1. -dDEBUG
How is your debug mode defined in fpc.cfg?
I don't have a fpc.cfg. So it must use some default mode, I'm not sure which options there are? I also added the -n parameter to make sure, there are no weird things inside a fpc.cfg somewhere.
2. -MDelphi
should be -Mdelphi
Alright, i changed that. However the delphi mode has been working already.
4. -gp
you are not using stabs but dwarf. Makes no sense.
Ok, I will remove that one and try again.
Since I did not see a whole of the heaptrc log:
It should report line numbers etc.
Yes you did see the whole heaptrace log. This is the main issue I'm facing now, that it only just writes these 4 lines into the report and no details like line numbers. Maybe it's just too much information (122488 unfreed memory blocks) and that causes an error. Or some other error preventing it to write the details. I will try a really short session to see if it will output details then.
But what you have got is a big gaping hole that should be spotted by just reading the code.
(you have read the wiki, and understood that heaptrc should not be added by hand? just -glh will do )
First hang back and look what can cause such massive leak, if you can not find it report back. It should be visible by eye and heaptrc log should identify line numbers, except if you have many inc files. In that case it will be off by some lines.
Yes, I noticed memory usage is continuously going up. That is only the case when using heaptrace and disabling mORMot's fpcx64mm memory manager (which is required according to the wiki).
This is a rather complex program and the memory leak usually happens within a single incident in varying time spans (like 1 week it's running at 350MB RAM and then suddenly jump to 450MB, then remain at 450MB for 2 days and then jump to 600MB for example). I'm not able to tell where the leak is, just by looking at the code, I'm afraid

Yes I read the wiki and did not add the heaptrace unit manually.