None of the threads close to the topic that I could find (like this one) helped me so far.
I have a C++ program that reads some data from a file, runs pretty complex and intensive operations and then writes outputs to new files. When I let the process run for few hours, here are the behaviours that I noticed:
- The CPU usage is quite constant, but the RAM is slowly increasing until it reaches a sort of ceiling, then it becomes constant too.
- The RAM usage 'ceiling' seems to increase depending on computer's RAM configuration. For example 3~4GB on a computer of 16GB of RAM, but 10~11GB on a computer of 64GB).
- The average time to generate files of similar complexity increases over time and at some point becomes huge (giving the impression that the program is not running anymore).
- When it starts slowing down that way, I kill the process and restart the generation of the same file (from scratch) with a fresh run of the program, and what took 3h before is finished in about 5min.
What can it be? I suspected memory leaking, but then wouldn't the RAM keep increasing indefinitely? What else can cause a program to progressively slow down, even when resources are available (CPU, RAM, disk space, etc.)?