Memory bubble search

It is either ridiculously simple or too complicated.

Our application has a form that loads some data from the database and displays it in a grid (just putting it). When the data is updated, the total memory consumption increases by about 50 thousand (Depending on how much data is displayed without a doubt). It sounds like a memory leak, but when we close the application, FastMM is installed with ReportMemoryLeakOnShutDown: = True , and it does not report abnormal memory leaks.

So it looks like we have a memory bubble or bag. Something that accumulates more memory every time it starts. Like a TList that continues to add new elements to it, but the old ones are never deleted. Then, during the shutdown process, all elements will be destroyed. The lines displayed in the grid do not grow, but behind the scenes there are many lists of objects that do this job, so it can be anywhere.

So my question is: if anyone knows of a good trick to find out which parts of the application use how much memory. ,, I can come up with many tedious ways to do this (what I do is check every list I can find), so I hope someone has a trick or technique that I did not think about.

Thanks in advance!

Update: Each update is updated using another 10-50 KB of memory. Users report that the application eventually stops responding. It certainly acts as a memory leak, but FastMM (memory manager) does not see the leak. I will try other memory tools.,

+3
source share
7 answers

Just F8 through the critical part and look at the graph of the use of the process (Process Explorer from Mark Russinovich works great for this). When you find the culprit method, repeat this process, but dive into this method.

+6
source

, AQTime, / . , .

+6

, , AllocMem(), FastMM.

.

- InitXXX WinAPI, -, . dll, .

+3

, ? , , , , . ( , - ?)

, , ?

0

FastMM, , , , / , , , , .

, / , N ? 50K ?

0

. , , , . , sharemem "" .

FastMM? , .

0

, AQTime , , , .

0

Source: https://habr.com/ru/post/1702668/


All Articles