Recently noticed one feature. Associated with memory, both static and dynamic. After I run the project several times, no matter what the complexity of the operations going on there, the computer starts to sag over RAM. How to deal with this and how to overcome such problems. And then every half an hour Mem Reduct'om I clean the RAM.

PS all dynamic unload.

  • Use the language with the garbage collector then at the end of the program it will clear the memory - zenden2k
  • @ zenden2k "I am writing on the pros, I wrote a program, I have to take it, but my memory is flowing, how can I track the problem?" - "RETRIEVE IN LANGUAGE WITH GC" - etki
  • What OS? Winda? - avp
  • May not leak, but defragmentation? Maybe your memory is intensively allocated with small blocks? Does the effect "dissolve" after a short time? - hardsky

2 answers 2

When the process completes its work, the OS in any case disposes of all its memory, regardless of how the program was written. Therefore, there are only two options:

  1. In fact, your program never stops
  2. The problem is not in your program at all.

Check item 1 is very simple - start the task manager and look for your program in the process list. If it is not there - then the problem is not in it.

By the way, in any case it is useful to look for anomalies in this list. As a rule, it is clearly seen which program is consuming memory. Usually these are browsers, although the IDE also likes this.

  • That's just the point, tested and watched what was happening, closed the browser. either this is an IDE of something I have not seen, either ... - KappaPolice
  • 3
    Task Manager can show the memory consumed by processes. Use it, do not read the tea leaves. - Pavel Mayorov

If you do not use WinApi to allocate memory in other processes and do not work in DOS, where distant pointers were available, the system will free the memory when the program ends.

  • “You use WinApi to allocate memory in other processes”. Wow! - VladD